Search in sources :

Example 6 with DefaultRegistryClient

use of com.alipay.sofa.registry.client.provider.DefaultRegistryClient in project dubbo by apache.

the class SofaRegistry method buildClient.

/**
 * Build client registry client.
 *
 * @param url the url
 * @return the registry client
 */
protected RegistryClient buildClient(URL url) {
    RegistryClientConfig config = DefaultRegistryClientConfigBuilder.start().setDataCenter(LOCAL_DATA_CENTER).setZone(LOCAL_REGION).setRegistryEndpoint(url.getHost()).setRegistryEndpointPort(url.getPort()).build();
    DefaultRegistryClient registryClient = new DefaultRegistryClient(config);
    registryClient.init();
    return registryClient;
}
Also used : DefaultRegistryClient(com.alipay.sofa.registry.client.provider.DefaultRegistryClient) RegistryClientConfig(com.alipay.sofa.registry.client.api.RegistryClientConfig)

Aggregations

DefaultRegistryClient (com.alipay.sofa.registry.client.provider.DefaultRegistryClient)6 RegistryClientConfig (com.alipay.sofa.registry.client.api.RegistryClientConfig)4