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,15 @@
|
||||
# Redis as the Spring cache with a Jackson 3 value serializer
|
||||
|
||||
|
||||
--- The result that was not Serializable now caches ---
|
||||
find(1) called twice, method body ran 1 time(s)
|
||||
second call returned: User[id=1, name=Ankur]
|
||||
|
||||
--- What is in Redis ---
|
||||
$ redis-cli -p 6390 KEYS '*' | sort
|
||||
users::1
|
||||
$ redis-cli -p 6390 GET users::1
|
||||
{"@class":"com.ankurm.redis.model.User","id":1,"name":"Ankur"}
|
||||
$ redis-cli -p 6390 --no-raw TTL users::1
|
||||
(integer) 300
|
||||
spring.cache.redis.time-to-live=10m is set, and the bean says 5 minutes
|
||||
Reference in New Issue
Block a user