Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2203

spring boot + redis cache + @Cacheable works for some methods and not others

$
0
0

I am using spring boot with redis for a cache, to improve application performance by reducing querying the RDBMS system.It works, as it caches the methods of another controller accurately but it does not cache the controller below:

@RequestMapping(method = RequestMethod.GET)    @Cacheable("findByTaxOfficeId")    private TaxPayerNameResponse findByTaxOfficeId(@RequestParam(required = true, value = "uid") String taxOfficeId) {        StampDutyOffice stampDutyOffice = null;

The configuration looks the same for the working spring boot controller.A sample of a cached Controller method that works properly can be found below:

 @RequestMapping(value = "/stampdutyoffice", method = RequestMethod.GET)    @Cacheable("getTaxPayerNameByTinIdOrJtbIdReqParam2")    public TaxPayerNameResponse2 getTaxPayerNameByTinIdOrJtbIdReqParam2(@RequestParam(required = true, value = "uid") String tinIdOrJtbIdStampDutyOffice) {        return getTaxPayerNameByTinIdOrJtbId2(tinIdOrJtbIdStampDutyOffice);    }

What could be the issue please?Thanks in advance for helping out.


Viewing all articles
Browse latest Browse all 2203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>