我将redis用作缓存层,在那儿,我有很多地方在不同的服务和层中使用@Cacheable。
这是示例代码:
buildscript {
repositories {
jcenter()
google() //Add this repo
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
}
}
allprojects {
repositories {
jcenter()
google() //Add this repo
}
}
应用程序和缓存工作正常,但是当我使用以下命令获取redis-cli中的所有键时:
@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
}
它仅显示呼叫_1和呼叫_2的键。 并且不显示“ my_detail”的密钥。
这很奇怪,没有解决。任何建议,这是怎么了。