jetcache jedis 需要 4.2.3 版本 么 spring boot 2.7.3 默认依赖jedis版本是3.8.0 使用时会报找不到redis/clients/jedis/commands/StringBinaryCommands错误

7z5jn7bk  于 2022-11-02  发布在  Spring
关注(0)|答案(5)|浏览(937)
  • No description provided.*
zzlelutf

zzlelutf1#

看文档,需要新版jedis。 spring-data默认用的lettuce,如果你的spring-data没用jedis可以自己手工把jedis升级一下。

wtzytmuj

wtzytmuj2#

按文档
https://github.com/alibaba/jetcache/blob/master/docs/CN/RedisWithLettuce.md

不使用spring boot 的配置
出现如下错误

Caused by: com.alicp.jetcache.CacheConfigException: PubSubConnection not set
at com.alicp.jetcache.redis.lettuce.LettuceBroadcastManager.(LettuceBroadcastManager.java:43) ~[jetcache-redis-lettuce-2.7.0.jar:?]
at com.alicp.jetcache.redis.lettuce.RedisLettuceCacheBuilder.createBroadcastManager(RedisLettuceCacheBuilder.java:43) ~[jetcache-redis-lettuce-2.7.0.jar:?]
at com.alicp.jetcache.template.NotifyMonitorInstaller.addMonitors(NotifyMonitorInstaller.java:45) ~[jetcache-core-2.7.0.jar:?]
at com.alicp.jetcache.SimpleCacheManager.create(SimpleCacheManager.java:148) ~[jetcache-core-2.7.0.jar:?]
at com.alicp.jetcache.SimpleCacheManager.lambda$getOrCreateCache$4(SimpleCacheManager.java:110) ~[jetcache-core-2.7.0.jar:?]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:1.8.0_221]
at com.alicp.jetcache.SimpleCacheManager.getOrCreateCache(SimpleCacheManager.java:110) ~[jetcache-core-2.7.0.jar:?]

pkbketx9

pkbketx93#

你用lettuce为什么会和spring boot冲突呢

v440hwme

v440hwme4#

后来换成普通spring 工程了。

5ssjco0h

5ssjco0h5#

发现问题了使用了lettuce后不能使用CacheManager
@Autowired
private CacheManager cacheManager;

相关问题