You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The Subscribe method subscribes to one node only when having Redis cluster #2750
I see that the subscriber always subscribes to one of the nodes (in my case "10.0.255.86:6379") and I guess it's because the Redis will broadcast each published message to all other nodes:
"The clients can send SUBSCRIBE to any node and can also send PUBLISH to any node. It will simply broadcast each published message to all other nodes."
It works as described if the message is indeed published by a client, but won't work the same way when it comes to internal messages published by the node itself, when a change occurs. For some reason only the node that owns the key/value entity will receive it. I don't know if that's a bug in Redis or it works this way by design but I tried to workaround it. I created a separate ConnectionMultiplexer connecting it to a single node. However, all the multiplexers always subscribe to "10.0.255.86:6379" including those that are connected to "10.0.255.87:6379" or "10.0.255.88:6379" and receive change notifications that happen on that node. I guess the ConnectionMultiplexer gets the whole list of nodes after connects and always subscribes for the first one.
So, if I'm not doing anything wrong, then I assume there is no way to control to which node to subscribe and respectively there is no way to receive Redis keyspace notifications from all the nodes using StackExchange.Redis.
changed the title [-]The Subsscribe subscribes to one node only when having Redis cluster[/-][+]The Subscribe method subscribes to one node only when having Redis cluster[/+]on Jun 27, 2024
Implemented in StackExchange.Redis 2.11.0 (#2995): cluster-wide keyspace/keyevent notifications via RedisChannelOptions.MultiNode and the RedisChannel.KeySpace/KeyEvent factory APIs (see docs/KeyspaceNotifications.md). Closing as completed.
Note: this needs the new multi-node channel APIs — a plain string-channel subscribe still targets a single node.
Activity
[-]The Subsscribe subscribes to one node only when having Redis cluster[/-][+]The Subscribe method subscribes to one node only when having Redis cluster[/+]mgravell commentedon Jul 22, 2026
Implemented in StackExchange.Redis 2.11.0 (#2995): cluster-wide keyspace/keyevent notifications via
RedisChannelOptions.MultiNodeand theRedisChannel.KeySpace/KeyEventfactory APIs (see docs/KeyspaceNotifications.md). Closing as completed.Note: this needs the new multi-node channel APIs — a plain string-channel subscribe still targets a single node.