I annotated my service as follows
@Cacheable(cacheNames = {"some"},
key = "{#req.some, #req.other, #req.property}")
public List<Some> listSome(SomeReq req) {
..
}
It seems work and I saw these keys via Medis.
(coupon
is the value of 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}
Where was the cacheNames
in action?
Is it possible to collide if I add other service method with same pattern of keys?
@Cacheable(cacheNames = {"someOther"},
key = "{#req.some, #req.other, #req.property}")
List<SomeOther> listSomeOthers(SomeOtherReq req) {
}