Java Code Examples for com.alibaba.dubbo.config.ReferenceConfig#setTimeout()
The following examples show how to use
com.alibaba.dubbo.config.ReferenceConfig#setTimeout() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ServiceFactory.java From dubbo-2.6.5 with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout, int clientNums) { ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append("dubbo://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 2
Source File: DubboUtils.java From java-master with Apache License 2.0 | 6 votes |
private static <T> ReferenceConfig<T> getReferenceConfig(Class<?> interfaceClass, String group, String version, String host) { String referenceKey = interfaceClass.getName(); ReferenceConfig<T> referenceConfig = new ReferenceConfig<>(); referenceConfig.setApplication(application); referenceConfig.setRegistry(getRegistryConfig(group, version)); referenceConfig.setInterface(interfaceClass); referenceConfig.setVersion(version); referenceConfig.setTimeout(30000); referenceConfig.setGeneric(true); if (StringUtils.isNotBlank(host)) { String url = String.format("dubbo://%s/%s", host, referenceKey); referenceConfig.setUrl(url); } return referenceConfig; }
Example 3
Source File: ServiceFactory.java From dubbox with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums, String protocol, String serialization){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append(protocol); url.append("://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); url.append("?optimizer=com.alibaba.dubbo.rpc.benchmark.SerializationOptimizerImpl"); if (!StringUtils.isEmpty(serialization)) { url.append("&serialization="); url.append(serialization); } referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 4
Source File: ServiceFactory.java From dubbox with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append("dubbo://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 5
Source File: ServiceFactory.java From dubbox-hystrix with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums, String protocol, String serialization){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append(protocol); url.append("://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); url.append("?optimizer=com.alibaba.dubbo.rpc.benchmark.SerializationOptimizerImpl"); if (!StringUtils.isEmpty(serialization)) { url.append("&serialization="); url.append(serialization); } referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 6
Source File: ServiceFactory.java From dubbox-hystrix with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append("dubbo://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 7
Source File: ServiceFactory.java From dubbox with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums, String protocol, String serialization){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append(protocol); url.append("://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); url.append("?optimizer=com.alibaba.dubbo.rpc.benchmark.SerializationOptimizerImpl"); if (!StringUtils.isEmpty(serialization)) { url.append("&serialization="); url.append(serialization); } referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 8
Source File: ServiceFactory.java From dubbox with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append("dubbo://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 9
Source File: ServiceFactory.java From dubbox with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append("dubbo://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 10
Source File: ServiceFactory.java From dubbox with Apache License 2.0 | 6 votes |
protected T createClient(Class<T> cls, String targetIP, int targetPort, int connectTimeout,int clientNums, String protocol, String serialization){ ReferenceConfig<T> referenceConfig = new ReferenceConfig<T>(); referenceConfig.setInterface(cls); StringBuilder url = new StringBuilder(); url.append(protocol); url.append("://"); url.append(targetIP); url.append(":"); url.append(targetPort); url.append("/"); url.append(cls.getName()); url.append("?optimizer=com.alibaba.dubbo.rpc.benchmark.SerializationOptimizerImpl"); if (!StringUtils.isEmpty(serialization)) { url.append("&serialization="); url.append(serialization); } referenceConfig.setUrl(url.toString()); // hardcode referenceConfig.setConnections(clientNums); ApplicationConfig application = new ApplicationConfig(); application.setName("dubbo_consumer"); referenceConfig.setApplication(application); referenceConfig.setTimeout(connectTimeout); return referenceConfig.get(); }
Example 11
Source File: DubboInvoker.java From dubbo-postman with MIT License | 5 votes |
ReferenceConfig<GenericService> createReference(PostmanDubboRequest request, DubboParamValue rpcParamValue){ ReferenceConfig<GenericService> newReference = new ReferenceConfig<GenericService>(); //设置默认超时无限制,用于在本地调试的时候用 newReference.setTimeout(Integer.MAX_VALUE); newReference.setApplication(application); newReference.setInterface(request.getInterfaceName()); String group = request.getGroup(); //default是我加的,dubbo默认是没有的 if(group.isEmpty() || group.equals("default")){ }else{ newReference.setGroup(group); } if(rpcParamValue.isUseDubbo()){ //直连 newReference.setUrl(rpcParamValue.getDubboUrl()); logger.info("直连dubbo地址:"+rpcParamValue.getDubboUrl()); }else{ //通过zk访问 newReference.setRegistry(new RegistryConfig(rpcParamValue.getRegistry())); } newReference.setVersion(request.getVersion()); newReference.setGeneric(true); //hard code newReference.setRetries(1); return newReference; }
Example 12
Source File: XAResourceDeserializerImpl.java From ByteJTA with GNU Lesser General Public License v3.0 | 5 votes |
private void processInitRemoteParticipantIfNecessary(String application) { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); TransactionBeanRegistry beanRegistry = TransactionBeanRegistry.getInstance(); RemoteCoordinator participant = participantRegistry.getParticipant(application); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(15000); referenceConfig.setCluster("failfast"); referenceConfig.setLoadbalance("bytejta"); referenceConfig.setFilter("bytejta"); referenceConfig.setGroup(application); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setScope(Constants.SCOPE_REMOTE); referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } participantRegistry.putParticipant(application, reference); } }
Example 13
Source File: XAResourceDeserializerImpl.java From ByteJTA with GNU Lesser General Public License v3.0 | 5 votes |
private void processInitPhysicalInstanceIfNecessary(RemoteAddr remoteAddr) throws RpcException { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); TransactionBeanRegistry beanRegistry = TransactionBeanRegistry.getInstance(); RemoteCoordinator participant = participantRegistry.getPhysicalInstance(remoteAddr); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(15000); referenceConfig.setCluster("failfast"); referenceConfig.setLoadbalance("bytejta"); referenceConfig.setFilter("bytejta"); referenceConfig.setGroup("org-bytesoft-bytejta"); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setUrl(String.format("%s:%s", remoteAddr.getServerHost(), remoteAddr.getServerPort())); referenceConfig.setScope(Constants.SCOPE_REMOTE); referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } participantRegistry.putPhysicalInstance(remoteAddr, reference); } }
Example 14
Source File: DubboGenericServiceInvoker.java From jsongood with Apache License 2.0 | 5 votes |
public void connectRegistry() { Long s = System.currentTimeMillis(); ReferenceConfig<RegistryService> reference = new ReferenceConfig<RegistryService>(); reference.setApplication(application); reference.setRegistries(registryList); // 多个注册中心可以用setRegistries() reference.setInterface(RegistryService.class); // 弱类型接口名 reference.setRetries(0); reference.setTimeout(5000); RegistryService registryService = reference.get(); Long t = System.currentTimeMillis() - s; logger.info("connectRegistry success ,spend time=" + t + "ms"); }
Example 15
Source File: CompensableSecondaryFilter.java From ByteTCC with GNU Lesser General Public License v3.0 | 5 votes |
private void processInitRemoteParticipantIfNecessary(RemoteAddr remoteAddr) throws RpcException { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); CompensableBeanRegistry beanRegistry = CompensableBeanRegistry.getInstance(); RemoteCoordinator participant = participantRegistry.getPhysicalInstance(remoteAddr); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(6 * 1000); referenceConfig.setCluster("failfast"); referenceConfig.setFilter("bytetcc"); referenceConfig.setGroup("x-bytetcc"); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setUrl(String.format("%s:%s", remoteAddr.getServerHost(), remoteAddr.getServerPort())); referenceConfig.setScope(Constants.SCOPE_REMOTE); referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } participantRegistry.putPhysicalInstance(remoteAddr, reference); } }
Example 16
Source File: CompensablePrimaryFilter.java From ByteTCC with GNU Lesser General Public License v3.0 | 5 votes |
private void processInitRemoteParticipantIfNecessary(String application) { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); CompensableBeanRegistry beanRegistry = CompensableBeanRegistry.getInstance(); // CompensableBeanFactory beanFactory = beanRegistry.getBeanFactory(); // CompensableCoordinator compensableCoordinator = (CompensableCoordinator) // beanFactory.getCompensableNativeParticipant(); RemoteCoordinator participant = participantRegistry.getParticipant(application); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(6 * 1000); referenceConfig.setCluster("failfast"); referenceConfig.setFilter("bytetcc"); referenceConfig.setGroup(String.format("z-%s", application)); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setScope(Constants.SCOPE_REMOTE); referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } // end-if (registryConfig != null) if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } participantRegistry.putParticipant(application, reference); } }
Example 17
Source File: CompensablePrimaryFilter.java From ByteTCC with GNU Lesser General Public License v3.0 | 5 votes |
private void processInitRemoteParticipantIfNecessary(RemoteAddr remoteAddr) throws RpcException { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); CompensableBeanRegistry beanRegistry = CompensableBeanRegistry.getInstance(); RemoteCoordinator participant = participantRegistry.getPhysicalInstance(remoteAddr); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(6 * 1000); referenceConfig.setCluster("failfast"); referenceConfig.setFilter("bytetcc"); referenceConfig.setGroup("z-bytetcc"); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setUrl(String.format("%s:%s", remoteAddr.getServerHost(), remoteAddr.getServerPort())); referenceConfig.setScope(Constants.SCOPE_REMOTE); referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } participantRegistry.putPhysicalInstance(remoteAddr, reference); } }
Example 18
Source File: TransactionServiceFilter.java From ByteJTA with GNU Lesser General Public License v3.0 | 5 votes |
private void processInitPhysicalInstanceIfNecessary(RemoteAddr remoteAddr) throws RpcException { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); TransactionBeanRegistry beanRegistry = TransactionBeanRegistry.getInstance(); RemoteCoordinator participant = participantRegistry.getPhysicalInstance(remoteAddr); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(15000); referenceConfig.setCluster("failfast"); referenceConfig.setLoadbalance("bytejta"); referenceConfig.setFilter("bytejta"); referenceConfig.setGroup("org-bytesoft-bytejta"); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setUrl(String.format("%s:%s", remoteAddr.getServerHost(), remoteAddr.getServerPort())); referenceConfig.setScope(Constants.SCOPE_REMOTE); referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } participantRegistry.putPhysicalInstance(remoteAddr, reference); } }
Example 19
Source File: CompensableLoadBalance.java From ByteTCC with GNU Lesser General Public License v3.0 | 4 votes |
private void processInitRemoteParticipantIfNecessary(RemoteAddr remoteAddr) throws RpcException { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); CompensableBeanRegistry beanRegistry = CompensableBeanRegistry.getInstance(); CompensableBeanFactory beanFactory = beanRegistry.getBeanFactory(); CompensableCoordinator compensableCoordinator = (CompensableCoordinator) beanFactory.getCompensableNativeParticipant(); RemoteCoordinator participant = participantRegistry.getPhysicalInstance(remoteAddr); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(6 * 1000); referenceConfig.setCluster("failfast"); referenceConfig.setFilter("bytetcc"); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setUrl(String.format("%s:%s", remoteAddr.getServerHost(), remoteAddr.getServerPort())); referenceConfig.setScope(Constants.SCOPE_REMOTE); if (compensableCoordinator.isStatefully()) { referenceConfig.setGroup("x-bytetcc"); } else { referenceConfig.setGroup("z-bytetcc"); } referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } participantRegistry.putPhysicalInstance(remoteAddr, reference); } }
Example 20
Source File: XAResourceDeserializerImpl.java From ByteTCC with GNU Lesser General Public License v3.0 | 4 votes |
private void processInitRemoteParticipantIfNecessary(String application) { RemoteCoordinatorRegistry participantRegistry = RemoteCoordinatorRegistry.getInstance(); CompensableBeanRegistry beanRegistry = CompensableBeanRegistry.getInstance(); RemoteCoordinator participant = participantRegistry.getParticipant(application); if (participant == null) { ApplicationConfig applicationConfig = beanRegistry.getBean(ApplicationConfig.class); RegistryConfig registryConfig = beanRegistry.getBean(RegistryConfig.class); ProtocolConfig protocolConfig = beanRegistry.getBean(ProtocolConfig.class); ReferenceConfig<RemoteCoordinator> referenceConfig = new ReferenceConfig<RemoteCoordinator>(); referenceConfig.setInterface(RemoteCoordinator.class); referenceConfig.setTimeout(6 * 1000); referenceConfig.setCluster("failfast"); referenceConfig.setFilter("bytetcc"); referenceConfig.setCheck(false); referenceConfig.setRetries(-1); referenceConfig.setScope(Constants.SCOPE_REMOTE); if (this.statefully) { referenceConfig.setGroup(String.format("x-%s", application)); referenceConfig.setLoadbalance("bytetcc"); } else { referenceConfig.setGroup(String.format("z-%s", application)); } referenceConfig.setApplication(applicationConfig); if (registryConfig != null) { referenceConfig.setRegistry(registryConfig); } // end-if (registryConfig != null) if (protocolConfig != null) { referenceConfig.setProtocol(protocolConfig.getName()); } // end-if (protocolConfig != null) RemoteCoordinator reference = referenceConfig.get(); if (reference == null) { throw new RpcException("Cannot get the application name of the remote application."); } // end-if (reference == null) participantRegistry.putParticipant(application, reference); } }