I have implemented redis cache in my springboot project. There is a date column in a table which needs to be updated when a user access a company account. This column update should be done only when redis cache expires I tried creating redisTemplate and used redis.getExpire method to know the time remains for the cache to expire. But that redisTemplate getExpire will get triggered only when the method is called. What can I do so that even when I don't call the method that condition will be checked and column gets updated
Asked
Active
Viewed 365 times
0
-
Please provide enough code so others can better understand or reproduce the problem. – Community Dec 13 '22 at 19:07
1 Answers
0
If you are setting TTL for keys in redis then you can listen for expiration events. for this first you need to enable event publishing in redis server and then create a listener in java which will receive expiration events.
Please go through below is answer on stackoverflow for code help.

Nouman Ahmed
- 96
- 4