Here is a sample of a Java Spring Boot Redis Cluster Data configuration.
It is an implementation with Redis Cluster and Redis Cache Manager.
- Snappy Compression
- Kryo Serialization
- Support ttl per cache key
- spring-data-redis
- lettuce-core
- snappy-java
- kryo
- commons-codec
data.rediscluster.nodes=redis1.foo.com:6379,redis2.foo.com:6379,redis3.foo.com:6379,redis4.foo.com:6379,redis5.foo.com:6379,redis6.foo.com:6379
data.rediscluster.ttl=2700
data.rediscluster.redirects=3
RedisCacheConfiguration.defaultCacheConfig()
.disableKeyPrefix()
.disableCachingNullValues()
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(stringRedisSerializer()))
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(genericSnappyRedisSerializer()))
.entryTtl(Duration.ofSeconds(ttl));