ZooKeeper: how to connect when the session has expired?

The ZooKeeper FAQ reports that the ZooKeeper object should be recreated when the state becomes SESSION_EXPIRED.

Are there any examples of code that correctly remix? The Recipes folder in the zookeeper distribution contains two code samples that assume that the session never expires. This is naive, because after the server is connected from the ZooKeeper cluster for 5 minutes, both queues and blocking will not work again after reconnecting.

+3
source share
2 answers

You can see this code in the cages library .

+1
source

ZkClient . , ,

0

All Articles