📚 开源资源分享——颜佐光的个人书架
✉️ 联系站长
书架 / Java / SpringBoot

SpringBoot JetCache redis.lettuce yml密码配置

2021-03-23 17:57 · 约 661 字 · 浏览 3,566 次 · 更新 2021-03-24 10:35SpringBoot缓存

SpringBoot JetCache redis.lettuce yml密码配置

项目中使用了jetcache并使用remote远程redis缓存,type为redis.lettuce,搞半天不知道密码怎么配置,官网也没写,只能啃源码了,发现密码配置在uri上,做个记录。。

yml配置

jetcache:
  statIntervalMinutes: 30
  areaInCacheName: false
  local:
    default:
      type: caffeine
      keyConvertor: fastjson
      limit: 5000
      expireAfterWriteInMillis: 120000
  remote:
    default:
      type: redis.lettuce
      keyConvertor: fastjson
      valueEncoder: kryo
      valueDecoder: kryo
      # uri格式:redis://密码@ip:端口/redis库名?timeout=5s
      uri: redis://123456@127.0.0.1:6379/1?timeout=5s
      poolConfig:
        minIdle: 5
        maxIdle: 20
        maxTotal: 50
← 返回《Java》目录书架 →