if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when subscribe from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e);
if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when subscribe from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e);
/** * 反注册服务 */ protected void unregister() { if (providerConfig.isRegister()) { List<RegistryConfig> registryConfigs = providerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); try { registry.unRegister(providerConfig); } catch (Exception e) { String appName = providerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when unRegister from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e); } } } } } }
/** * 反注册服务 */ protected void unregister() { if (providerConfig.isRegister()) { List<RegistryConfig> registryConfigs = providerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); try { registry.unRegister(providerConfig); } catch (Exception e) { String appName = providerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when unRegister from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e); } } } } } }
/** * 取消订阅服务列表 */ public void unSubscribe() { if (StringUtils.isEmpty(consumerConfig.getDirectUrl()) && consumerConfig.isSubscribe()) { List<RegistryConfig> registryConfigs = consumerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); try { registry.unSubscribe(consumerConfig); } catch (Exception e) { String appName = consumerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when unSubscribe from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e); } } } } } }
/** * 取消订阅服务列表 */ public void unSubscribe() { if (StringUtils.isEmpty(consumerConfig.getDirectUrl()) && consumerConfig.isSubscribe()) { List<RegistryConfig> registryConfigs = consumerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); try { registry.unSubscribe(consumerConfig); } catch (Exception e) { String appName = consumerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when unSubscribe from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e); } } } } } }
/** * 注册服务 */ protected void register() { if (providerConfig.isRegister()) { List<RegistryConfig> registryConfigs = providerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); registry.init(); registry.start(); try { registry.register(providerConfig); } catch (SofaRpcRuntimeException e) { throw e; } catch (Throwable e) { String appName = providerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when register to registry: " + registryConfig.getId(), e); } } } } } }
/** * 注册服务 */ protected void register() { if (providerConfig.isRegister()) { List<RegistryConfig> registryConfigs = providerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); registry.init(); registry.start(); try { registry.register(providerConfig); } catch (SofaRpcRuntimeException e) { throw e; } catch (Throwable e) { String appName = providerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when register to registry: " + registryConfig.getId(), e); } } } } } }
public static void copyRegistryFields(com.alipay.sofa.rpc.config.RegistryConfig sofaRegistryConfig, com.alibaba.dubbo.config.RegistryConfig dubboRegistryConfig) { dubboRegistryConfig.setAddress(sofaRegistryConfig.getAddress()); dubboRegistryConfig.setProtocol(sofaRegistryConfig.getProtocol()); dubboRegistryConfig.setRegister(sofaRegistryConfig.isRegister()); dubboRegistryConfig.setSubscribe(sofaRegistryConfig.isSubscribe()); dubboRegistryConfig.setAddress(sofaRegistryConfig.getAddress()); dubboRegistryConfig.setTimeout(sofaRegistryConfig.getTimeout()); dubboRegistryConfig.setId(sofaRegistryConfig.getId()); dubboRegistryConfig.setParameters(sofaRegistryConfig.getParameters()); } }
public static void copyRegistryFields(com.alipay.sofa.rpc.config.RegistryConfig sofaRegistryConfig, com.alibaba.dubbo.config.RegistryConfig dubboRegistryConfig) { dubboRegistryConfig.setAddress(sofaRegistryConfig.getAddress()); dubboRegistryConfig.setProtocol(sofaRegistryConfig.getProtocol()); dubboRegistryConfig.setRegister(sofaRegistryConfig.isRegister()); dubboRegistryConfig.setSubscribe(sofaRegistryConfig.isSubscribe()); dubboRegistryConfig.setAddress(sofaRegistryConfig.getAddress()); dubboRegistryConfig.setTimeout(sofaRegistryConfig.getTimeout()); dubboRegistryConfig.setId(sofaRegistryConfig.getId()); dubboRegistryConfig.setParameters(sofaRegistryConfig.getParameters()); } }
if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when subscribe from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e);
/** * 反注册服务 */ protected void unregister() { if (providerConfig.isRegister()) { List<RegistryConfig> registryConfigs = providerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); try { registry.unRegister(providerConfig); } catch (Exception e) { String appName = providerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when unRegister from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e); } } } } } }
/** * 取消订阅服务列表 */ public void unSubscribe() { if (StringUtils.isEmpty(consumerConfig.getDirectUrl()) && consumerConfig.isSubscribe()) { List<RegistryConfig> registryConfigs = consumerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); try { registry.unSubscribe(consumerConfig); } catch (Exception e) { String appName = consumerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when unSubscribe from registry: " + registryConfig.getId() + ", but you can ignore if it's called by JVM shutdown hook", e); } } } } } }
/** * 注册服务 */ protected void register() { if (providerConfig.isRegister()) { List<RegistryConfig> registryConfigs = providerConfig.getRegistry(); if (registryConfigs != null) { for (RegistryConfig registryConfig : registryConfigs) { Registry registry = RegistryFactory.getRegistry(registryConfig); registry.init(); registry.start(); try { registry.register(providerConfig); } catch (SofaRpcRuntimeException e) { throw e; } catch (Throwable e) { String appName = providerConfig.getAppName(); if (LOGGER.isWarnEnabled(appName)) { LOGGER.warnWithApp(appName, "Catch exception when register to registry: " + registryConfig.getId(), e); } } } } } }
public static void copyRegistryFields(com.alipay.sofa.rpc.config.RegistryConfig sofaRegistryConfig, com.alibaba.dubbo.config.RegistryConfig dubboRegistryConfig) { dubboRegistryConfig.setAddress(sofaRegistryConfig.getAddress()); dubboRegistryConfig.setProtocol(sofaRegistryConfig.getProtocol()); dubboRegistryConfig.setRegister(sofaRegistryConfig.isRegister()); dubboRegistryConfig.setSubscribe(sofaRegistryConfig.isSubscribe()); dubboRegistryConfig.setAddress(sofaRegistryConfig.getAddress()); dubboRegistryConfig.setTimeout(sofaRegistryConfig.getTimeout()); dubboRegistryConfig.setId(sofaRegistryConfig.getId()); dubboRegistryConfig.setParameters(sofaRegistryConfig.getParameters()); } }