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,23 @@
|
||||
# Redis as the Spring cache: what the defaults store
|
||||
|
||||
|
||||
--- Which cache manager did Boot pick? ---
|
||||
org.springframework.data.redis.cache.RedisCacheManager
|
||||
|
||||
--- A Serializable result, cached ---
|
||||
findSerializable(1) called twice, method body ran 1 time(s)
|
||||
$ redis-cli -p 6390 KEYS '*' | sort
|
||||
legacy::1
|
||||
$ redis-cli -p 6390 --no-raw TTL legacy::1
|
||||
(integer) 600
|
||||
$ redis-cli -p 6390 --no-raw GET legacy::1
|
||||
"\xac\xed\x00\x05sr\x00'com.ankurm.redis.model.SerializableUser\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02J\x00\x02idL\x00\x04namet\x00\x12Ljava/lang/String;xp\x00\x00\x00\x00\x00\x00\x00\x01t\x00\x05Ankur"
|
||||
|
||||
--- A result that is not Serializable ---
|
||||
users.find(1)
|
||||
java.lang.IllegalStateException
|
||||
message: Cannot serialize value of type com.ankurm.redis.model.User without a serializer
|
||||
root: Cannot serialize value of type com.ankurm.redis.model.User without a serializer
|
||||
method body ran 2 time(s) in total
|
||||
$ redis-cli -p 6390 KEYS '*' | sort
|
||||
legacy::1
|
||||
Reference in New Issue
Block a user