Repository navigation
Replies: 1 comment
|
What you are seeing is expected: keyspace notifications use Redis Pub/Sub, so every subscribed pod receives the expiration event. Pub/Sub does not elect one consumer, persist the event, or provide acknowledgement/retry semantics. If the action is best-effort, each pod can attempt an atomic claim before doing the work, for example If the action must run reliably exactly once from the application's perspective, do not use an expiration notification as the work queue. Redis documents Pub/Sub delivery as at-most-once: an event is lost if every subscriber is disconnected when it is published. A stronger design is:
A single dedicated subscriber removes duplicate processing between pods, but it still does not solve lost events during disconnects or restarts. References: keyspace notifications and Pub/Sub delivery semantics. |
Uh oh!
There was an error while loading. Please reload this page.
Hi all, I want to know if anyone has faced the following issue.
I have a nodejs application with a redis client with a key-event subscription and when my keys are expired i manage it with some actions. In my case, I've two pods of the nodejs application, so i've 2 notifications for each expired key.
How I can manage this kind of situation and manage only once time the expiration?
Have you some suggestion?
Thanks in advance.
All reactions