gradle
implementation("org.redisson:redisson-spring-boot-starter:3.20.1")
yaml
spring:
redis:
host: xxx
port: 6379
database: 0
password: xxx
timeout: 3600
lettuce:
pool:
max-active: 3
max-wait: 5
max-idle: 3
min-idle: 0
client-name: redisson_demo
redisson:
# file: classpath:redisson.yaml
config: |
threads: 16
nettyThreads: 16
singleServerConfig:
address: "redis://${spring.redis.host}:${spring.redis.port}"
password: ${spring.redis.password}
subscriptionConnectionPoolSize: 50
connectionPoolSize: 100
idleConnectionTimeout: 10000
connectTimeout: 10000
timeout: 3000
retryInterval: 1500
pingConnectionInterval: 1000
dnsMonitoringInterval: 1000
or
spring:
redis:
host: xxx
port: 6379
database: 0
password: xxx
timeout: 3600
lettuce:
pool:
max-active: 3
max-wait: 5
max-idle: 3
min-idle: 0
client-name: redisson_demo
redisson:
file: classpath:redisson.yaml
threads: 16
nettyThreads: 16
singleServerConfig:
address: "redis://${spring.redis.host}:${spring.redis.port}"
password: ${spring.redis.password}
subscriptionConnectionPoolSize: 50
connectionPoolSize: 100
idleConnectionTimeout: 10000
connectTimeout: 10000
timeout: 3000
retryInterval: 1500
pingConnectionInterval: 1000
dnsMonitoringInterval: 1000
初始化源码:
redisson-spring-boot -starter初始化过程