@Override public void init() { synchronized (MeshRegistry.class) { if (!inited) { String address = registryConfig.getAddress(); client = new MeshApiClient(address); inited = true; } } }
@Override public void init() { synchronized (MeshRegistry.class) { if (!inited) { String address = registryConfig.getAddress(); client = new MeshApiClient(address); inited = true; } } }
@Override public synchronized void init() { if (namingService != null) { return; } String addressInput = registryConfig.getAddress(); // xxx:8848,yyy:8848/namespace if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of nacos registry is empty."); } int idx = addressInput.indexOf(CONTEXT_SEP); String namespace; String address; // IP地址 if (idx > 0) { address = addressInput.substring(0, idx); namespace = addressInput.substring(idx); } else { address = addressInput; namespace = DEFAULT_NAMESPACE; } defaultCluster = Collections.singletonList(NacosRegistryHelper.DEFAULT_CLUSTER); Properties nacosConfig = new Properties(); nacosConfig.put(PropertyKeyConst.SERVER_ADDR, address); nacosConfig.put(PropertyKeyConst.NAMESPACE, namespace); try { namingService = NamingFactory.createNamingService(nacosConfig); } catch (NacosException e) { throw new SofaRpcRuntimeException("Init nacos naming service error, address: " + address); } }
@Override public synchronized void init() { if (namingService != null) { return; } String addressInput = registryConfig.getAddress(); // xxx:8848,yyy:8848/namespace if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of nacos registry is empty."); } int idx = addressInput.indexOf(CONTEXT_SEP); String namespace; String address; // IP地址 if (idx > 0) { address = addressInput.substring(0, idx); namespace = addressInput.substring(idx); } else { address = addressInput; namespace = DEFAULT_NAMESPACE; } defaultCluster = Collections.singletonList(NacosRegistryHelper.DEFAULT_CLUSTER); Properties nacosConfig = new Properties(); nacosConfig.put(PropertyKeyConst.SERVER_ADDR, address); nacosConfig.put(PropertyKeyConst.NAMESPACE, namespace); try { namingService = NamingFactory.createNamingService(nacosConfig); } catch (NacosException e) { throw new SofaRpcRuntimeException("Init nacos naming service error, address: " + address); } }
public String[] validateIp(RegistryConfig registryConfig) { String addressInput = registryConfig.getAddress(); // xxx:2181,yyy:2181/path1/paht2 if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of consul registry is empty."); } int idx = addressInput.indexOf(CONTEXT_SEP); String address; // IP地址 if (idx > 0) { address = addressInput.substring(0, idx); rootPath = addressInput.substring(idx); } else { address = addressInput; rootPath = "/"; } if (!ConsulURLUtils.isValidAddress(address)) { throw new SofaRpcRuntimeException("Address format of consul registry is wrong."); } if (!rootPath.endsWith(CONTEXT_SEP)) { rootPath += CONTEXT_SEP; // 保证以"/"结尾 } String[] ipAndHost = StringUtils.split(address, ":"); return ipAndHost; }
public String[] validateIp(RegistryConfig registryConfig) { String addressInput = registryConfig.getAddress(); // xxx:2181,yyy:2181/path1/paht2 if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of consul registry is empty."); } int idx = addressInput.indexOf(CONTEXT_SEP); String address; // IP地址 if (idx > 0) { address = addressInput.substring(0, idx); rootPath = addressInput.substring(idx); } else { address = addressInput; rootPath = "/"; } if (!ConsulURLUtils.isValidAddress(address)) { throw new SofaRpcRuntimeException("Address format of consul registry is wrong."); } if (!rootPath.endsWith(CONTEXT_SEP)) { rootPath += CONTEXT_SEP; // 保证以"/"结尾 } String[] ipAndHost = StringUtils.split(address, ":"); return ipAndHost; }
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()); } }
return; String addressInput = registryConfig.getAddress(); // xxx:2181,yyy:2181/path1/paht2 if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of zookeeper registry is empty.");
return; String addressInput = registryConfig.getAddress(); // xxx:2181,yyy:2181/path1/paht2 if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of zookeeper registry is empty.");
@Override public void init() { synchronized (MeshRegistry.class) { if (!inited) { String address = registryConfig.getAddress(); client = new MeshApiClient(address); inited = true; } } }
@Override public synchronized void init() { if (namingService != null) { return; } String addressInput = registryConfig.getAddress(); // xxx:8848,yyy:8848/namespace if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of nacos registry is empty."); } int idx = addressInput.indexOf(CONTEXT_SEP); String namespace; String address; // IP地址 if (idx > 0) { address = addressInput.substring(0, idx); namespace = addressInput.substring(idx); } else { address = addressInput; namespace = DEFAULT_NAMESPACE; } defaultCluster = Collections.singletonList(NacosRegistryHelper.DEFAULT_CLUSTER); Properties nacosConfig = new Properties(); nacosConfig.put(PropertyKeyConst.SERVER_ADDR, address); nacosConfig.put(PropertyKeyConst.NAMESPACE, namespace); try { namingService = NamingFactory.createNamingService(nacosConfig); } catch (NacosException e) { throw new SofaRpcRuntimeException("Init nacos naming service error, address: " + address); } }
public String[] validateIp(RegistryConfig registryConfig) { String addressInput = registryConfig.getAddress(); // xxx:2181,yyy:2181/path1/paht2 if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of consul registry is empty."); } int idx = addressInput.indexOf(CONTEXT_SEP); String address; // IP地址 if (idx > 0) { address = addressInput.substring(0, idx); rootPath = addressInput.substring(idx); } else { address = addressInput; rootPath = "/"; } if (!ConsulURLUtils.isValidAddress(address)) { throw new SofaRpcRuntimeException("Address format of consul registry is wrong."); } if (!rootPath.endsWith(CONTEXT_SEP)) { rootPath += CONTEXT_SEP; // 保证以"/"结尾 } String[] ipAndHost = StringUtils.split(address, ":"); return ipAndHost; }
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()); } }
return; String addressInput = registryConfig.getAddress(); // xxx:2181,yyy:2181/path1/paht2 if (StringUtils.isEmpty(addressInput)) { throw new SofaRpcRuntimeException("Address of zookeeper registry is empty.");