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 @@
|
||||
# The RedisTemplate Boot gives you: JDK serialisation for keys and values
|
||||
|
||||
|
||||
--- Which serializers is it using? ---
|
||||
key serializer: JdkSerializationRedisSerializer
|
||||
value serializer: JdkSerializationRedisSerializer
|
||||
|
||||
--- Write a String under the key user:1 ---
|
||||
redisTemplate.opsForValue().set("user:1", "Ankur")
|
||||
|
||||
--- What redis-cli sees ---
|
||||
$ redis-cli -p 6390 --no-raw KEYS '*'
|
||||
1) "\xac\xed\x00\x05t\x00\x06user:1"
|
||||
$ redis-cli -p 6390 --no-raw GET user:1
|
||||
(nil)
|
||||
$ redis-cli -p 6390 --no-raw EVAL 'return redis.call("GET", redis.call("KEYS", "*")[1])' 0
|
||||
"\xac\xed\x00\x05t\x00\x05Ankur"
|
||||
|
||||
--- What Java sees ---
|
||||
redisTemplate.opsForValue().get("user:1") = Ankur
|
||||
Reference in New Issue
Block a user