【发布时间】:2020-02-29 16:03:05
【问题描述】:
我使用 redis 作为我的缓存层,在这方面,我有很多地方在我的不同服务和层中使用 @Cacheable。
这里是示例代码:
@Cacheable(value = "my_detail", key = "'m_detail_'+#entityIdd")
public InstituteDetail getMyDetail(Long entityId) {
call1();
call2()
}
@Cacheable(value = "call_1", key = "'call_1'+#entityIdd")
public InstituteDetail getMyDetail1(Long entityId) {
//some code
}
@Cacheable(value = "call_2", key = "'call_2'+#entityIdd")
public InstituteDetail getMyDetail2(Long entityId) {
//some code
}
应用程序和缓存工作正常,但是当我使用以下命令获取 redis-cli 中的所有键时:
keys *
它只显示 call_1 和 call_2 的键。 并且不显示“my_detail”的键。
这很奇怪,没有得到解决。任何建议这里有什么问题。
【问题讨论】:
标签: java caching redis cache-control jedis