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
@@ -83,10 +84,36 @@ public class DefaultMessageDelegate implements MessageDelegate {
83
84
84
85
Notice how the above implementation of the `MessageDelegate` interface (the above `DefaultMessageDelegate` class) has *no* Redis dependencies at all. It truly is a POJO that we make into an MDP with the following configuration:
NOTE: The listener topic can be either a channel (for example, `topic="chatroom"`) or a pattern (for example, `topic="*room"`)
107
135
108
-
The preceding example uses the Redis namespace to declare the message listener container and automatically register the POJOs as listeners. The fullblown beans definition follows:
136
+
The preceding example uses the Redis namespace to declare the message listener container and automatically register the POJOs as listeners. The full-blown beans definition follows:
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/redis.adoc
+70-4
Original file line number
Diff line number
Diff line change
@@ -391,7 +391,30 @@ Once configured, the template is thread-safe and can be reused across multiple i
391
391
392
392
For cases where you need a certain template view, declare the view as a dependency and inject the template. The container automatically performs the conversion, eliminating the `opsFor[X]` calls, as shown in the following example:
@@ -406,6 +429,7 @@ For cases where you need a certain template view, declare the view as a dependen
406
429
407
430
</beans>
408
431
----
432
+
====
409
433
410
434
[source,java]
411
435
----
@@ -430,7 +454,30 @@ public class Example {
430
454
431
455
Since it is quite common for the keys and values stored in Redis to be `java.lang.String`, the Redis modules provides two extensions to `RedisConnection` and `RedisTemplate`, respectively the `StringRedisConnection` (and its `DefaultStringRedisConnection` implementation) and `StringRedisTemplate` as a convenient one-stop solution for intensive String operations. In addition to being bound to `String` keys, the template and the connection use the `StringRedisSerializer` underneath, which means the stored keys and values are human-readable (assuming the same encoding is used both in Redis and your code). The following listings show an example:
@@ -662,7 +710,24 @@ Package `org.springframework.data.redis.support` offers various reusable compone
662
710
663
711
The atomic counters make it easy to wrap Redis key incrementation while the collections allow easy management of Redis keys with minimal storage exposure or API leakage. In particular, the `RedisSet` and `RedisZSet` interfaces offer easy access to the set operations supported by Redis, such as `intersection` and `union`. `RedisList` implements the `List`, `Queue`, and `Deque` contracts (and their equivalent blocking siblings) on top of Redis, exposing the storage as a FIFO (First-In-First-Out), LIFO (Last-In-First-Out) or capped collection with minimal configuration. The following example shows the configuration for a bean that uses a `RedisList`:
0 commit comments