jetcache-starter-redis在SpringBoot2.7.0环境读不到YML,还是我配置问题

shstlldc  于 22天前  发布在  Redis
关注(0)|答案(8)|浏览(19)

想问一下,使用Spring-data-redis的情况下改使用哪一个版本的starter,jetcache-starter-redis-data貌似没有看见文档。
然后引入jetcache-starter-redis依赖后,为什么我在application.yml里面配置,压根获取不到有jetcache的配置?如下:
无法解析配置属性 jetcache.xxxxx ,压根没有jetchche的配置属性节点。

使用jetcache-starter-redis错误如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisAutoInit' defined in class path resource [com/alicp/jetcache/autoconfigure/RedisAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: redis/clients/jedis/UnifiedJedis
哪位大佬帮忙看看,属实配置不明白这玩意,spring-cache引入开启就可以,这个按照文档来配不成

n53p2ov0

n53p2ov01#

jedis版本的问题。 无法解析配置属性什么的,只是IDE不认识,不影响运行

aiazj4mn

aiazj4mn2#

那是不是使用jetcache-starter-redis-springdata就可以兼容spring-data-redis依赖?

pexxcrt2

pexxcrt23#

如果你配置type: redis.springdata的话,那么jetcache使用spring-data(对应的start是jetcache-starter-redis-springdata)来访问redis,jedis的版本(如果你的spring-data使用jedis来访问redis的话)应该以spring-data为准。

否则如果你配置type: redis的话,你的jetcache将直接访问redis,此时不依赖spring-data,对应的starter是jetcache-starter-redis,应该以jetcache要求的jedis版本为准。

p5cysglq

p5cysglq4#

好的,最后我想问一下目前jetcache有删除同一个name下的所有key的缓存的操作没,想springcache那样

oewdyzsn

oewdyzsn6#

啊,那我岂不是需要手动的去进行批量清楚缓存操作,有没有类似的解决方法呢?

xzv2uavs

xzv2uavs7#

一个办法是你自己换一个前缀

yc0p9oo0

yc0p9oo08#

我用cacheManager构建缓存处理对象,它可以批量删除(removeAll),参数是一个缓存key的List,但是我有分页缓存,没法子去获取到这些key的值,难道没有一个最优的解决方法吗,不能批量删除缓存太难搞了。

相关问题