use of org.apache.dubbo.config.ConsumerConfig in project dubbo by alibaba.
the class ConsumerBuilder method build.
@Override
public ConsumerConfig build() {
ConsumerConfig consumer = new ConsumerConfig();
super.build(consumer);
consumer.setDefault(isDefault);
consumer.setClient(client);
consumer.setThreadpool(threadpool);
consumer.setCorethreads(corethreads);
consumer.setThreads(threads);
consumer.setQueues(queues);
consumer.setShareconnections(shareconnections);
consumer.setUrlMergeProcessor(urlMergeProcessor);
return consumer;
}
use of org.apache.dubbo.config.ConsumerConfig in project dubbo by alibaba.
the class ReferenceBuilderTest method consumer.
@Test
void consumer() {
ConsumerConfig consumer = new ConsumerConfig();
ReferenceBuilder builder = new ReferenceBuilder();
builder.consumer(consumer);
Assertions.assertSame(consumer, builder.build().getConsumer());
}
use of org.apache.dubbo.config.ConsumerConfig in project dubbo by alibaba.
the class ConsumerBuilderTest method build.
@Test
void build() {
ConsumerBuilder builder = new ConsumerBuilder();
builder.isDefault(true).client("client").threadPool("threadPool").coreThreads(10).threads(100).queues(200).shareConnections(300).id("id").prefix("prefix");
ConsumerConfig config = builder.build();
ConsumerConfig config2 = builder.build();
Assertions.assertTrue(config.isDefault());
Assertions.assertEquals("client", config.getClient());
Assertions.assertEquals("threadPool", config.getThreadpool());
Assertions.assertEquals("id", config.getId());
Assertions.assertEquals("prefix", config.getPrefix());
Assertions.assertEquals(10, config.getCorethreads());
Assertions.assertEquals(100, config.getThreads());
Assertions.assertEquals(200, config.getQueues());
Assertions.assertEquals(300, config.getShareconnections());
Assertions.assertNotSame(config, config2);
}
use of org.apache.dubbo.config.ConsumerConfig 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);
}
use of org.apache.dubbo.config.ConsumerConfig in project dubbo by alibaba.
the class ReferenceBeanBuilder method configureConsumerConfig.
private void configureConsumerConfig(AnnotationAttributes attributes, ReferenceBean<?> referenceBean) {
String consumerBeanName = getAttribute(attributes, "consumer");
ConsumerConfig consumerConfig = getOptionalBean(applicationContext, consumerBeanName, ConsumerConfig.class);
referenceBean.setConsumer(consumerConfig);
}
Aggregations