Closed oronge closed 6 months ago
subscriber()
method randomly picks a node, and creates a connection to it. It does not keep connections to every master. This is a different behavior from RedisCluster.
Regards
subscriber()
method randomly picks a node, and creates a connection to it. It does not keep connections to every master. This is a different behavior from RedisCluster.Regards
thanks for your reply
you said subscriber() method randomly picks a node, and creates a connection to it,is this means the node may be a master or a slave ?
It depends. If you create RedisCluster with MASTER role, then RedisCluster::subscriber
creates connection to a random master. If you create it with SLAVE role, then RedisCluster::subscriber
creates connection to a random slave.
Regards
It depends. If you create RedisCluster with MASTER role, then
RedisCluster::subscriber
creates connection to a random master. If you create it with SLAVE role, thenRedisCluster::subscriber
creates connection to a random slave.Regards
thanks
if the connection between Subscriber and node is broken, will the Subscriber try to connect to the node in the future ?
So far, NO, it won't reconnect. As the doc mentioned, once you get an exception, you need to create a new Subscriber.
get, thank you for your reply!
hello
In ReadMe, I notice RedisCluster keep at least one connection with every master,if I get a Subscriber by method subscriber(),how many connections the Subscriber keep? will it keep connections with every master ?
thanks very much