skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

    use parameter group in aws to set config and pass the keys in it.


  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search