use of io.servicecomb.serviceregistry.config.ServiceRegistryConfig in project java-chassis by ServiceComb.
the class RegistryThread method doInit.
public void doInit() {
ServiceRegistryConfig serviceRegistryConfig = ServiceRegistryConfig.INSTANCE;
try {
if (isEmpty(RegistryUtils.getMicroservice().getServiceId())) {
RegistryUtils.ensureRegisterMicroservice();
}
if (isEmpty(RegistryUtils.getMicroserviceInstance().getInstanceId())) {
RegistryUtils.ensureRegisterInstance();
}
// 初始化client发现SR的动态集群扩容能力
if (serviceRegistryConfig.isRegistryAutoDiscovery()) {
IpPortManager.INSTANCE.createServiceRegistryCache();
}
} catch (TimerException e) {
RegistryUtils.exception(e);
return;
}
registerSuccess = true;
NotifyManager.INSTANCE.notify(RegistryEvent.INITIALIZED, null);
}
Aggregations