【发布时间】:2019-06-24 07:48:27
【问题描述】:
我将我的服务注释如下
@Cacheable(cacheNames = {"some"},
key = "{#req.some, #req.other, #req.property}")
public List<Some> listSome(SomeReq req) {
..
}
似乎可行,我通过 Medis 看到了这些密钥。
(coupon 是spring.cache.redis.key-prefix 的值。)
coupon{Some},{Other},{Property}
coupon{Some},{Other},{Property}
coupon{Some},{Other},{Property}
coupon{Some},{Other},{Property}
coupon{Some},{Other},{Property}
coupon{Some},{Other},{Property}
cacheNames 在哪里运行?
如果我添加具有相同键模式的其他服务方法,是否可能发生冲突?
@Cacheable(cacheNames = {"someOther"},
key = "{#req.some, #req.other, #req.property}")
List<SomeOther> listSomeOthers(SomeOtherReq req) {
}
【问题讨论】: