79277915

Date: 2024-12-13 10:15:06
Score: 1
Natty:
Report link

Even I faced the similar issue after using this it got fixed and required data is being stored in redis Cache only after satisfying condition (I need to store in the cache only if result is not null and and also success should not be false).

 @Cacheable(value = "myBucketName", key = "#dto.mobNumber", unless = "(#result == null || #result.success == false)")
public SummaryDto getSummary(Dto dto) {
    return repository.getSummary(dto);
}
Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: D V N RAGHAVENDRA PRASAD KOPPA