标签:nbsp lead code actor default art ssi string col
RetryPolicy retryPolicy = new ExponentialBackoffRetry(3000,3);
(curator-framework\src\main\java\org\apache\curator\framework\CuratorFramework.java)
curator-framework\src\main\java\org\apache\curator\framework
CuratorFrameworkFactory.java
default:
CuratorFramework newClient(String connectString, RetryPolicy retryPolicy);
client.newClient("tdtc101:2181, tdtc102:2181, tdtc103:2181", retryPolicy);
advanced:
CuratorFramework newClient(String connectString, int sessionTimeoutMs, int connectionTimeoutMs, RetryPolicy retryPolicy);
client.newClient("tdtc101:2181, tdtc102:2181, tdtc103:2181", 60 * 1000, 15 * 1000, retryPolicy);
default:
client = CuratorFrameworkFactory.builder()
.connectString("tdtc101:2181, tdtc102:2181, tdtc103:2181")
.retryPolicy(retryPolicy)
.build();
advanced:
client = CuratorFrameworkFactory.builder()
.connectString("tdtc101:2181, tdtc102:2181, tdtc103:2181")
.sessionTimeoutMs(60 * 1000) // CuratorFrameworkFactory.java Ln61
.connectionTimeoutMs(15 * 1000) // CuratorFrameworkFactory.java Ln62
.retryPolicy(retryPolicy)
.build();
client.start();
标签:nbsp lead code actor default art ssi string col
原文地址:https://www.cnblogs.com/xiaobin-hlj80/p/9655078.html