'Consuming Expired key events from Redis cluster in Spring Boot application
I am relatively new to REDIS. I am working with Spring Boot application with Redis running in cluster mode.
In my application, in order to implement a certain use case, I need to consume expire events for a set of keys.
From Redis documentation on key expiry: key expiry in REDIS, it seems expired events are generated when the Redis server deletes the key and this may not be exactly when the time to live theoretically reaches the value of zero.
Also, as I mentioned above, Redis is running in cluster mode and from the article, it seems, to receive all keyspace events of a cluster, clients need to subscribe to each of the nodes.
Basically, my spring boot application is running on three k8s pods and I would like to consume the expired events for a key exactly when latter gets expired, by each of the pods.
In this regard, I have been able to implement Redis pub/sub in multiple pod set up, but I am not able to understand how should I do this for expiry event of keys in Redis cluster set up.
I have searched for this and found a quite a few posts as follows:
- Expired key trigger event - Spring data Redis
- How to Enable Keyspace Notifications for Expired Keys using Spring Data Redis
- Spring data redis - listen to expiration event
But, in these articles, I did not find any clue regarding how to achieve this.
Could anyone please give some pointers regarding this ? Thanks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
