I am using go-redis/v8 as a client library and its universal client to get/set etc. I am subscribing to the keyspace notifications like the one below.
keyspace := fmt.Sprintf("__keyspace@%d__:%s", s.config.Redis.DB, key)
ch := s.rdb.GetClient().Subscribe(ctx, keyspace).Channel()
It seems subscriber is not getting any notification in cluster mode of Redis. But it's working in dev env when the Redis was set up in docker-compose in standalone mode. I was researching about this and what I found out from Redis documentation is -
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.
But with go-redis as I am creating the universal client with all the node ip's why the subscriber is not working as expected?