@Cacheable在同一个类中方法调用不起作用

上述图片中,同一个类中genLiveBullets()方法调用同类中的queryLiveByRoom()方法,这样即便标识了Cacheable标签,再次调用时也没有走缓存。cacheable不支持内部方法调用的方式,需要修改为把请求缓存的改成service方式,Aservice中的genLiveBullets()调用Bservice中的queryLiveByRoom(),见下图,已测试再次调用时为走的缓存。

@Cacheable在同一个类中方法调用不起作用

相关文章:

  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-07-06
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-20
  • 2021-07-13
  • 2021-10-26
  • 2021-04-16
  • 2021-07-30
  • 2022-12-23
相关资源
相似解决方案