Search in sources :

Example 51 with RegistryConfig

use of org.apache.dubbo.config.RegistryConfig in project dubbo by alibaba.

the class InvokerSideConfigUrlTest method initRefConf.

// ======================================================
// private helper
// ======================================================
private void initRefConf() {
    regConfForConsumer = new RegistryConfig();
    regConfForReference = new RegistryConfig();
    methodConfForReference = new MethodConfig();
    refConf = new ReferenceConfig<DemoService>();
    consumerConf = new ConsumerConfig();
    methodConfForReference.setName("sayName");
    regConfForReference.setAddress("127.0.0.1:9090");
    regConfForReference.setProtocol("mockregistry");
    refConf.setInterface("org.apache.dubbo.config.api.DemoService");
    refConf.setApplication(application);
    // consumerConf.setApplication(appConfForConsumer);
    refConf.setRegistry(regConfForReference);
    consumerConf.setRegistry(regConfForConsumer);
    refConf.setConsumer(consumerConf);
    refConf.setMethods(Arrays.asList(new MethodConfig[] { methodConfForReference }));
    refConf.setScope(SCOPE_REMOTE);
}
Also used : RegistryConfig(org.apache.dubbo.config.RegistryConfig) MethodConfig(org.apache.dubbo.config.MethodConfig) DemoService(org.apache.dubbo.config.api.DemoService) ConsumerConfig(org.apache.dubbo.config.ConsumerConfig)

Example 52 with RegistryConfig

use of org.apache.dubbo.config.RegistryConfig in project dubbo by alibaba.

the class ReferenceConfigCacheTest method buildXxxMockReferenceConfig.

private XxxMockReferenceConfig buildXxxMockReferenceConfig(String service, String group, String version) {
    XxxMockReferenceConfig config = new XxxMockReferenceConfig();
    config.setApplication(new ApplicationConfig("cache"));
    config.setRegistry(new RegistryConfig("multicast://224.5.6.7:1234"));
    config.setInterface(service);
    config.setCheck(false);
    config.setGroup(group);
    config.setVersion(version);
    return config;
}
Also used : RegistryConfig(org.apache.dubbo.config.RegistryConfig) ApplicationConfig(org.apache.dubbo.config.ApplicationConfig)

Example 53 with RegistryConfig

use of org.apache.dubbo.config.RegistryConfig in project dubbo by alibaba.

the class MetadataServiceExporterTest method init.

@BeforeAll
public static void init() {
    ApplicationModel.reset();
    ApplicationModel.getConfigManager().setApplication(new ApplicationConfig("Test"));
    ApplicationModel.getConfigManager().addRegistry(new RegistryConfig("test://1.2.3.4"));
    ApplicationModel.getConfigManager().addProtocol(new ProtocolConfig("injvm"));
}
Also used : RegistryConfig(org.apache.dubbo.config.RegistryConfig) ApplicationConfig(org.apache.dubbo.config.ApplicationConfig) ProtocolConfig(org.apache.dubbo.config.ProtocolConfig) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 54 with RegistryConfig

use of org.apache.dubbo.config.RegistryConfig in project dubbo by alibaba.

the class ServiceAnnotationTestConfiguration2 method registryConfig.

/**
 * Current registry center configuration, to replace XML config:
 * <prev>
 * &lt;dubbo:registry id="my-registry" address="N/A"/&gt;
 * </prev>
 *
 * @return {@link RegistryConfig} Bean
 */
@Bean("my-registry")
public RegistryConfig registryConfig() {
    RegistryConfig registryConfig = new RegistryConfig();
    registryConfig.setAddress("N/A");
    return registryConfig;
}
Also used : RegistryConfig(org.apache.dubbo.config.RegistryConfig) Bean(org.springframework.context.annotation.Bean)

Example 55 with RegistryConfig

use of org.apache.dubbo.config.RegistryConfig in project dubbo by alibaba.

the class ServiceAnnotationTestConfiguration method registryConfig.

/**
 * Current registry center configuration, to replace XML config:
 * <prev>
 * &lt;dubbo:registry id="my-registry" address="N/A"/&gt;
 * </prev>
 *
 * @return {@link RegistryConfig} Bean
 */
@Bean("my-registry")
public RegistryConfig registryConfig() {
    RegistryConfig registryConfig = new RegistryConfig();
    registryConfig.setAddress("N/A");
    return registryConfig;
}
Also used : RegistryConfig(org.apache.dubbo.config.RegistryConfig) Bean(org.springframework.context.annotation.Bean)

Aggregations

RegistryConfig (org.apache.dubbo.config.RegistryConfig)68 ApplicationConfig (org.apache.dubbo.config.ApplicationConfig)42 Test (org.junit.jupiter.api.Test)34 ProtocolConfig (org.apache.dubbo.config.ProtocolConfig)29 DubboBootstrap (org.apache.dubbo.config.bootstrap.DubboBootstrap)20 ServiceConfig (org.apache.dubbo.config.ServiceConfig)19 ReferenceConfig (org.apache.dubbo.config.ReferenceConfig)16 DemoService (org.apache.dubbo.config.spring.api.DemoService)13 GenericService (org.apache.dubbo.rpc.service.GenericService)8 ArrayList (java.util.ArrayList)7 URL (org.apache.dubbo.common.URL)7 DemoServiceImpl (org.apache.dubbo.config.spring.impl.DemoServiceImpl)7 ConsumerConfig (org.apache.dubbo.config.ConsumerConfig)5 Matchers.containsString (org.hamcrest.Matchers.containsString)5 ModuleConfig (org.apache.dubbo.config.ModuleConfig)4 MonitorConfig (org.apache.dubbo.config.MonitorConfig)4 ProviderConfig (org.apache.dubbo.config.ProviderConfig)4 Bean (org.springframework.context.annotation.Bean)4 List (java.util.List)3 MethodConfig (org.apache.dubbo.config.MethodConfig)3