As the title says, was there a spring data redis mapping to the Redisson framework (http://redisson.org)
-
There is no Spring Data integration with Redisson. – mp911de Oct 14 '16 at 06:27
-
1redisson has a package to work with spring data redis. – kapad Feb 27 '18 at 08:24
2 Answers
Short answer
There is Spring Data Redis integration
Long answer
Consider Spring Data Redis integration as another type of connector or binding (check here for the connector term). The library provides RedissonConnectionFactory
(implements RedisConnectionFactory
) which would be the base for working with e.g. @RedisHash
and spring cache abstraction (@EnableCaching
). There's also a redisson-spring-boot-starter but make sure not to have lettuce
or jedis
in classpath because org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
(provided by spring-boot-autoconfigure) might create a RedisConnectionFactory
before org.redisson.spring.starter.RedissonAutoConfiguration
(provided by redisson-spring-boot-starter)!

- 3,321
- 2
- 29
- 46
-
-
redisson-spring-boot-starter is a Spring Boot starter over Spring Data Redis integration – Adrian Feb 19 '23 at 10:07
-
https://stackoverflow.com/a/28273660/5506988 OK so i know what spring boot starter is now. – Mark Feb 19 '23 at 18:06
Add redisson-spring-boot-starter dependency into your project:
compile 'org.redisson:redisson-spring-boot-starter:3.13.5'
Add settings into application.settings file
common spring boot props:
spring:
redis:
database:
host:
port:
password:
ssl:
timeout:
cluster:
nodes:
sentinel:
master:
nodes:
redisson:
file: classpath:redisson.yaml
config: |
clusterServersConfig:
idleConnectionTimeout: 10000
connectTimeout: 10000
timeout: 3000
retryAttempts: 3
retryInterval: 1500
failedSlaveReconnectionInterval: 3000
failedSlaveCheckInterval: 60000
password: null
subscriptionsPerConnection: 5
clientName: null
loadBalancer: !<org.redisson.connection.balancer.RoundRobinLoadBalancer> {}
subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 50
slaveConnectionMinimumIdleSize: 24
slaveConnectionPoolSize: 64
masterConnectionMinimumIdleSize: 24
masterConnectionPoolSize: 64
readMode: "SLAVE"
subscriptionMode: "SLAVE"
nodeAddresses:
- "redis://127.0.0.1:7004"
- "redis://127.0.0.1:7001"
- "redis://127.0.0.1:7000"
scanInterval: 1000
pingConnectionInterval: 0
keepAlive: false
tcpNoDelay: false
threads: 16
nettyThreads: 32
codec: !<org.redisson.codec.FstCodec> {}
transportMode: "NIO"
3.Use Redisson through spring bean with RedissonClient interface or RedisTemplate/ReactiveRedisTemplate objects

- 36,709
- 117
- 359
- 710
-
2I am still trying to think how this answer is helpful. Copy-paste from https://github.com/redisson/redisson/tree/master/redisson-spring-boot-starter but does not answer even part of the question. – shankulk Jan 31 '23 at 22:55
-
1