引入reidsson--基于redisson-spring-boot-starter

目录

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初始化过程

加载配置分析:

基于redisson学习加载”文本”配置文件

打赏一个呗

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦