xiebin2015 commented on issue #2002:
URL:
https://github.com/apache/shardingsphere-elasticjob/issues/2002#issuecomment-971261582
Hi @TeslaCN
@Bean(initMethod = "init")
public CoordinatorRegistryCenter zookeeperRegistryCenter() {
ZookeeperConfiguration zkConfig = new
ZookeeperConfiguration(zookeeperProperties.getServerLists(),
zookeeperProperties.getNamespace());
zkConfig.setBaseSleepTimeMilliseconds(zookeeperProperties.getBaseSleepTimeMilliseconds());
zkConfig.setConnectionTimeoutMilliseconds(zookeeperProperties.getConnectionTimeoutMilliseconds());
zkConfig.setDigest(zookeeperProperties.getDigest());
zkConfig.setMaxRetries(zookeeperProperties.getMaxRetries());
zkConfig.setMaxSleepTimeMilliseconds(zookeeperProperties.getMaxSleepTimeMilliseconds());
zkConfig.setSessionTimeoutMilliseconds(zookeeperProperties.getSessionTimeoutMilliseconds());
CoordinatorRegistryCenter coordinatorRegistryCenter = new
ZookeeperRegistryCenter(zkConfig);
coordinatorRegistryCenter.init();
return coordinatorRegistryCenter;
}
@Override
public ScheduleJobBootstrap prepareScheduleJobBootstrap(Job job, Object
jobBean) throws PendingException {
try {
//作业对象
ElasticJob elasticjob = (ElasticJob) jobBean;
return new ScheduleJobBootstrap(getCoordinatorRegistryCenter(),
elasticjob, jobCoreConfiguration(job));
} catch (Exception e) {
log.error("【" + job.getJobName() + "】\t初始化失败", e);
throw new PendingException(SysCode.SYS_FAIL, "\"【\" +
job.getJobName() + \"】\\t初始化失败", e);
}
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]