Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2019 09:05
What would you like to do?
public static CuratorFramework createConnection(String zookeeperConnectionString) {
//First retry will wait for 1 second,
//the second will wait up to 2 seconds,
//the third will wait upto 4 seconds.
RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
CuratorFramework client = CuratorFrameworkFactory.builder()
.zookeeperFactory(new DefaultZookeeperFactory())
return client;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment