- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration
类的一些代码示例,展示了ZookeeperConfiguration
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperConfiguration
类的具体详情如下:
包路径:com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration
类名称:ZookeeperConfiguration
[英]基于Zookeeper的注册中心配置.
[中]基于动物园管理员的注册中心配置.
代码示例来源:origin: LuoLiangDSGA/spring-learning
@Bean
public ZookeeperConfiguration zkConfig() {
return new ZookeeperConfiguration(serverlists, namespace);
}
代码示例来源:origin: pcbest/elastic-job-lite-starter-master
/**
* Reg center zookeeper registry center.
*
* @return the zookeeper registry center
*/
@Bean(initMethod = "init")
@ConditionalOnMissingBean
public ZookeeperRegistryCenter regCenter() {
ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(regCenterProperties.getZkAddressList(), regCenterProperties.getNamespace());
zookeeperConfiguration.setBaseSleepTimeMilliseconds(regCenterProperties.getBaseSleepTimeMilliseconds());
zookeeperConfiguration.setConnectionTimeoutMilliseconds(regCenterProperties.getConnectionTimeoutMilliseconds());
zookeeperConfiguration.setMaxSleepTimeMilliseconds(regCenterProperties.getMaxSleepTimeMilliseconds());
zookeeperConfiguration.setSessionTimeoutMilliseconds(regCenterProperties.getSessionTimeoutMilliseconds());
zookeeperConfiguration.setMaxRetries(regCenterProperties.getMaxRetries());
zookeeperConfiguration.setDigest(regCenterProperties.getDigest());
return new ZookeeperRegistryCenter(zookeeperConfiguration);
}
代码示例来源:origin: com.dangdang/elastic-job-common-core
@Override
public void init() {
log.debug("Elastic job: zookeeper registry center init, server lists is: {}.", zkConfig.getServerLists());
CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder()
.connectString(zkConfig.getServerLists())
.retryPolicy(new ExponentialBackoffRetry(zkConfig.getBaseSleepTimeMilliseconds(), zkConfig.getMaxRetries(), zkConfig.getMaxSleepTimeMilliseconds()))
.namespace(zkConfig.getNamespace());
if (0 != zkConfig.getSessionTimeoutMilliseconds()) {
builder.sessionTimeoutMs(zkConfig.getSessionTimeoutMilliseconds());
if (0 != zkConfig.getConnectionTimeoutMilliseconds()) {
builder.connectionTimeoutMs(zkConfig.getConnectionTimeoutMilliseconds());
if (!Strings.isNullOrEmpty(zkConfig.getDigest())) {
builder.authorization("digest", zkConfig.getDigest().getBytes(Charsets.UTF_8))
.aclProvider(new ACLProvider() {
client.start();
try {
if (!client.blockUntilConnected(zkConfig.getMaxSleepTimeMilliseconds() * zkConfig.getMaxRetries(), TimeUnit.MILLISECONDS)) {
client.close();
throw new KeeperException.OperationTimeoutException();
代码示例来源:origin: com.dangdang/elastic-job-lite-lifecycle
/**
* 创建注册中心.
*
* @param connectString 注册中心连接字符串
* @param namespace 注册中心命名空间
* @param digest 注册中心凭证
* @return 注册中心对象
*/
public static CoordinatorRegistryCenter createCoordinatorRegistryCenter(final String connectString, final String namespace, final Optional<String> digest) {
Hasher hasher = Hashing.md5().newHasher().putString(connectString, Charsets.UTF_8).putString(namespace, Charsets.UTF_8);
if (digest.isPresent()) {
hasher.putString(digest.get(), Charsets.UTF_8);
}
HashCode hashCode = hasher.hash();
CoordinatorRegistryCenter result = REG_CENTER_REGISTRY.get(hashCode);
if (null != result) {
return result;
}
ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(connectString, namespace);
if (digest.isPresent()) {
zkConfig.setDigest(digest.get());
}
result = new ZookeeperRegistryCenter(zkConfig);
result.init();
REG_CENTER_REGISTRY.put(hashCode, result);
return result;
}
}
代码示例来源:origin: elasticjob/elastic-job-example
@Bean(initMethod = "init")
public ZookeeperRegistryCenter regCenter(@Value("${regCenter.serverList}") final String serverList, @Value("${regCenter.namespace}") final String namespace) {
return new ZookeeperRegistryCenter(new ZookeeperConfiguration(serverList, namespace));
}
}
代码示例来源:origin: elasticjob/elastic-job-example
private static CoordinatorRegistryCenter setUpRegistryCenter() {
ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(ZOOKEEPER_CONNECTION_STRING, JOB_NAMESPACE);
CoordinatorRegistryCenter result = new ZookeeperRegistryCenter(zkConfig);
result.init();
return result;
}
代码示例来源:origin: lord-of-code/loc-framework
private ZookeeperRegistryCenter registerCenter(LocElasticJobProperties elasticJobProperties) {
ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(
elasticJobProperties.getServerList(), elasticJobProperties.getNamespace());
BeanUtils
.copyProperties(elasticJobProperties, zookeeperConfiguration, "serverLists", "namespace");
ZookeeperRegistryCenter registryCenter = new ZookeeperRegistryCenter(zookeeperConfiguration);
registryCenter.init();
return registryCenter;
}
本文整理了Java中com.bazaarvoice.curator.dropwizard.ZooKeeperConfiguration.newCurator()方法的一些代码示例,展示了ZooKeep
本文整理了Java中com.bazaarvoice.curator.dropwizard.ZooKeeperConfiguration.newManagedCurator()方法的一些代码示例,展示了
本文整理了Java中com.uber.marmaray.common.configuration.ZookeeperConfiguration.getZkQuorum()方法的一些代码示例,展示了Zo
本文整理了Java中com.uber.marmaray.common.configuration.ZookeeperConfiguration.()方法的一些代码示例,展示了ZookeeperConf
本文整理了Java中com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration.setDigest()方法的一些代码示例,展示了Zook
本文整理了Java中com.dangdang.ddframe.job.reg.zookeeper.ZookeeperConfiguration.()方法的一些代码示例,展示了ZookeeperConf
我是一名优秀的程序员,十分优秀!