You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/introduction/getting-started.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ NoSQL stores have taken the storage world by storm. It is a vast domain with a p
21
21
[[get-started:first-steps:samples]]
22
22
=== Trying out the Samples
23
23
24
-
One can find various samples for key-value stores in the dedicated Spring Data example repo, at https://github.com/spring-projects/spring-data-keyvalue-examples[http://github.com/spring-projects/spring-data-keyvalue-examples]. For Spring Data Redis, you should pay particular attention to the `retwisj` sample, a Twitter-clone built on top of Redis that can be run locally or be deployed into the cloud. See its http://static.springsource.org/spring-data/data-keyvalue/examples/retwisj/current/[documentation], the following blog http://blog.springsource.com/2011/04/27/getting-started-redis-spring-cloud-foundry/[entry] or the http://retwisj.cloudfoundry.com/[live instance] for more information.
24
+
One can find various samples for key-value stores in the dedicated Spring Data example repo, at https://github.com/spring-projects/spring-data-keyvalue-examples[http://github.com/spring-projects/spring-data-keyvalue-examples]. For Spring Data Redis, you should pay particular attention to the `retwisj` sample, a Twitter-clone built on top of Redis that can be run locally or be deployed into the cloud. See its http://static.springsource.org/spring-data/data-keyvalue/examples/retwisj/current/[documentation], the following blog http://blog.springsource.com/2011/04/27/getting-started-redis-spring-cloud-foundry/[entry] for more information.
25
25
26
26
[[get-started:help]]
27
27
== Need Help?
@@ -46,7 +46,7 @@ For information on the Spring Data source code repository, nightly builds, and s
46
46
You can help make Spring Data best serve the needs of the Spring community by interacting with developers on Stack Overflow at either
47
47
http://stackoverflow.com/questions/tagged/spring-data[spring-data] or http://stackoverflow.com/questions/tagged/spring-data-redis[spring-data-redis].
48
48
49
-
If you encounter a bug or want to suggest an improvement (including to this documentation), please create a ticket on the Spring Data issue https://jira.springsource.org/browse/DATAREDIS[tracker].
49
+
If you encounter a bug or want to suggest an improvement (including to this documentation), please create a ticket on the Spring Data issue https://jira.spring.io/browse/DATAREDIS[tracker].
50
50
51
51
To stay up to date with the latest news and announcements in the Spring eco system, subscribe to the Spring Community http://spring.io/[Portal].
Spring Data Redis 1.x binaries require JDK level 6.0 and above and http://projects.spring.io/spring-framework/[Spring Framework] {springVersion} and above.
4
+
Spring Data Redis 2.x binaries require JDK level 8.0 and above and http://projects.spring.io/spring-framework/[Spring Framework] {springVersion} and above.
5
5
6
-
In terms of key-value stores, http://redis.io[Redis] 2.6.x or higher is required. Spring Data Redis is currently tested against the latest 3.2 release.
6
+
In terms of key-value stores, http://redis.io[Redis] 2.6.x or higher is required. Spring Data Redis is currently tested against the latest 4.0 release.
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/reactive-redis.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This section covers reactive Redis support and how to get started. Reactive Redi
7
7
[[redis:reactive:requirements]]
8
8
== Redis Requirements
9
9
10
-
Spring Data Redis requires Redis 2.6 or above and Java SE 8.0 or above. In terms of language bindings (or connectors), Spring Data Redis currently integrates with http://github.com/lettuce-io/lettuce-core[Lettuce] as the only reactive Java connector. https://projectreactor.io/[Project Reactor] is used as reactive composition library.
10
+
Spring Data Redis currently integrates with http://github.com/lettuce-io/lettuce-core[Lettuce] as the only reactive Java connector. https://projectreactor.io/[Project Reactor] is used as reactive composition library.
11
11
12
12
[[redis:reactive:connectors]]
13
13
== Connecting to Redis by Using a Reactive Driver
@@ -46,7 +46,7 @@ public ReactiveRedisConnectionFactory connectionFactory() {
46
46
}
47
47
----
48
48
49
-
The following exxample shows a more sophisticated configuration, including SSL and timeouts, that uses `LettuceClientConfigurationBuilder`:
49
+
The following example shows a more sophisticated configuration, including SSL and timeouts, that uses `LettuceClientConfigurationBuilder`:
TIP: The preceding examples demonstrate the general strategy followed by Spring Data Redis. Be aware that some operations might require loading huge amounts of data into memory to compute the desired command. Additionally, not all cross-slot requests can safely be ported to multiple single slot requests and error if misused (for example, `PFCOUNT`).
150
150
151
-
== Working with RedisTemplate and ClusterOperations
151
+
== Working with `RedisTemplate` and `ClusterOperations`
152
152
153
153
See the <<redis:template>> section for information about the general purpose, configuration, and usage of `RedisTemplate`.
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/redis-messaging.adoc
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
[[pubsub]]
2
-
= Redis Messaging and Pub/Sub
2
+
= Redis Messaging (Pub/Sub)
3
3
4
4
Spring Data provides dedicated messaging integration for Redis, similar in functionality and naming to the JMS integration in Spring Framework.
5
5
@@ -13,7 +13,7 @@ This is an example of the pattern often called Publish/Subscribe (Pub/Sub for sh
13
13
The `org.springframework.data.redis.connection` and `org.springframework.data.redis.listener` packages provide the core functionality for Redis messaging.
14
14
15
15
[[redis:pubsub:publish]]
16
-
== Publishing or Sending Messages
16
+
== Publishing (Sending Messages)
17
17
18
18
To publish a message, you can use, as with the other operations, either the low-level `RedisConnection` or the high-level `RedisTemplate`. Both entities offer the `publish` method, which accepts the message and the destination channel as arguments. While `RedisConnection` requires raw data (array of bytes), the `RedisTemplate` lets arbitrary objects be passed in as messages, as shown in the following example:
On the receiving side, one can subscribe to one or multiple channels either by naming them directly or by using pattern matching. The latter approach is quite useful, as it not only lets multiple subscriptions be created with one command but can also listen on channels not yet created at subscription time (as long as they match the pattern).
34
34
@@ -49,8 +49,8 @@ Due to its blocking nature, low-level subscription is not attractive, as it requ
49
49
50
50
Furthermore, to minimize the application footprint, `RedisMessageListenerContainer` lets one connection and one thread be shared by multiple listeners even though they do not share a subscription. Thus, no matter how many listeners or channels an application tracks, the runtime cost remains the same throughout its lifetime. Moreover, the container allows runtime configuration changes so that you can add or remove listeners while an application is running without the need for a restart. Additionally, the container uses a lazy subscription approach, using a `RedisConnection` only when needed. If all the listeners are unsubscribed, cleanup is automatically performed, and the thread is released.
51
51
52
-
To help with the asynchronous nature of messages, the container requires a `java.util.concurrent.Executor` (or Spring's `TaskExecutor`) for dispatching the messages. Depending on the load, the number of listeners, or the runtime environment, you should change or tweak the executor to better serve your needs. In particular, in managed environments (such as app servers), it is highly recommended to pick a proper `TaskExecutor` to take advantage of its runtime.
53
-
// TODO How can one know which is "proper"?
52
+
To help with the asynchronous nature of messages, the container requires a `java.util.concurrent.Executor` (or Spring's `TaskExecutor`) for dispatching the messages. Depending on the load, the number of listeners, or the runtime environment, you should change or tweak the executor to better serve your needs. In particular, in managed environments (such as app servers), it is highly recommended to pick a proper `TaskExecutor` to take advantage of its runtime.
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/redis-repositories.adoc
+30-30Lines changed: 30 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Spring Data Redis lets you easily implement domain entities, as shown in the fol
14
14
====
15
15
[source,java]
16
16
----
17
-
@RedisHash("persons")
17
+
@RedisHash("people")
18
18
public class Person {
19
19
20
20
@Id String id;
@@ -88,15 +88,15 @@ public void basicCrudOperations() {
88
88
repo.delete(rand); <4>
89
89
}
90
90
----
91
-
<1> Generates a new `id` if the current value is `null` or reuses an already set `id` value and stores properties of type `Person` inside the Redis Hash with a key that has a pattern of `keyspace:id` -- in this case, it might be `persons:5d67b7e1-8640-4475-beeb-c666fab4c0e5`.
91
+
<1> Generates a new `id` if the current value is `null` or reuses an already set `id` value and stores properties of type `Person` inside the Redis Hash with a key that has a pattern of `keyspace:id` -- in this case, it might be `people:5d67b7e1-8640-4475-beeb-c666fab4c0e5`.
92
92
<2> Uses the provided `id` to retrieve the object stored at `keyspace:id`.
93
-
<3> Counts the total number of entities available within the keyspace, `persons`, defined by `@RedisHash` on `Person`.
93
+
<3> Counts the total number of entities available within the keyspace, `people`, defined by `@RedisHash` on `Person`.
94
94
<4> Removes the key for the given object from Redis.
95
95
====
96
96
97
97
[[redis.repositories.mapping]]
98
98
== Object-to-Hash Mapping
99
-
The Redis Repository support persists Objects in Hashes. This requires an Object-to-Hash conversion which is done by a `RedisConverter`. The default implementation uses `Converter` for mapping property values to and from Redis native `byte[]`.
99
+
The Redis Repository support persists Objects to Hashes. This requires an Object-to-Hash conversion which is done by a `RedisConverter`. The default implementation uses `Converter` for mapping property values to and from Redis native `byte[]`.
100
100
101
101
Given the `Person` type from the previous sections, the default mapping looks like the following:
102
102
@@ -338,7 +338,7 @@ public class ApplicationConfig {
In the preceding example the, longitude and latitude values are stored by using `GEOADD` that use the object's `id` as the member's name. The finder methods allow usage of `Circle` or `Point, Distance` combinations for querying those values.
@@ -586,7 +586,7 @@ The `RedisKeyExpiredEvent` holds a copy of the expired domain object as well as
586
586
587
587
NOTE: Delaying or disabling the expiry event listener startup impacts `RedisKeyExpiredEvent` publishing. A disabled event listener does not publish expiry events. A delayed startup can cause loss of events because of the delayed listener initialization.
588
588
589
-
NOTE: The keyspace notification message listener alters `notify-keyspace-events` settings in Redis, if those are not already set. Existing settings are not overridden, so you must set up those settings correctly (or leav them empty). Note that `CONFIG` is disabled on AWS ElastiCache, and enabling the listener leads to an error.
589
+
NOTE: The keyspace notification message listener alters `notify-keyspace-events` settings in Redis, if those are not already set. Existing settings are not overridden, so you must set up those settings correctly (or leave them empty). Note that `CONFIG` is disabled on AWS ElastiCache, and enabling the listener leads to an error.
590
590
591
591
NOTE: Redis Pub/Sub messages are not persistent. If a key expires while the application is down, the expiry event is not processed, which may lead to secondary indexes containing references to the expired object.
0 commit comments