Reputation: 79
I'am using aws elastiCache for redis in cluster mode in my project . I'v used key space notification feature of redis to listen for particular expiry event.It works fine without clustering .But after clustering, I'm unable to get message in subscribe block.
subscribe(`__keyevent@0__:expired`);
redis keyspace notification aws elastiCache for redis
Upvotes: 2
Views: 2455
Reputation: 171
Make sure you are listening on all nodes
From the manual...
Events in a cluster
Every node of a Redis cluster generates events about its own subset of the keyspace as described above. However, unlike regular Pub/Sub communication in a cluster, events' notifications are not broadcasted to all nodes. Put differently, keyspace events are node-specific. This means that to receive all keyspace events of a cluster, clients need to subscribe to each of the nodes.
Upvotes: 2
Reputation: 79
use parameter group in aws to set config and pass the keys in it.
Upvotes: 0