alibaba / jetcache

JetCache is a Java cache framework.
Apache License 2.0
4.96k stars 1.03k forks source link

cacheType指定了BOTH或者REMOTE时,不配置jetcache.remote再调用缓存方法能否不影响主业务 #893

Closed NoTimeKeeper closed 1 month ago

NoTimeKeeper commented 1 month ago

情况是这样的,我目前搭建的一个脚手架想要实现缓存在不同项目下,采用不同的部署策略 比如一个项目比较小,完全不需要搭建分布式应用,也没必要上redis 其他项目比较重要,就搭建了分布式,上了redis集群 然后是同一套代码

从配置上 我可以选择是否摘掉 jetcache.remote 配置就实现 但是在使用@Cached这些注解就会直接让整个函数抛出异常 能否控制是否开启远程,不开启,哪怕cacheType选择了远程,也不抛出异常影响主体业务

image

NoTimeKeeper commented 1 month ago

已解决,使用了 jetcache.remote.default.type=mock 解决 参考 https://github.com/alibaba/jetcache/issues/824 https://github.com/alibaba/jetcache/issues/451