Add redis: Boot 4.1 + Spring Data Redis 4.1, the JDK-serialisation default vs Jackson 3 serializers, @RedisHash TTL and keyspace events, @RedisListener, and Redis as the Spring cache
Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B38FGKKam5SCGgwgduVAh3
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Pub/Sub is at-most-once: a stopped listener loses messages
|
||||
|
||||
|
||||
--- Stop the listener container, then publish ---
|
||||
container.stop()
|
||||
$ redis-cli -p 6390 --no-raw PUBSUB NUMSUB news
|
||||
1) "news"
|
||||
2) (integer) 0
|
||||
template.convertAndSend("news", "while you were away") = 0 receivers
|
||||
|
||||
--- Start it again ---
|
||||
container.start()
|
||||
$ redis-cli -p 6390 --no-raw PUBSUB NUMSUB news
|
||||
1) "news"
|
||||
2) (integer) 1
|
||||
messages the listener has: []
|
||||
|
||||
--- Once it is back, messages flow again ---
|
||||
template.convertAndSend("news", "welcome back") = 1 receiver
|
||||
@RedisListener got 'welcome back'
|
||||
Reference in New Issue
Block a user