diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConsumerConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConsumerConfig.java index 812d676f691..42d67f08e2d 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConsumerConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ConsumerConfig.java @@ -31,6 +31,18 @@ public class ConsumerConfig extends AbstractReferenceConfig { // networking framework client uses: netty, mina, etc. private String client; + // consumer thread pool type: cached, fixed, limit, eager + private String threadpool; + + // consumer threadpool core thread size + private Integer corethreads; + + // consumer threadpool thread size + private Integer threads; + + // consumer threadpool queue size + private Integer queues; + @Override public void setTimeout(Integer timeout) { super.setTimeout(timeout); @@ -56,4 +68,40 @@ public String getClient() { public void setClient(String client) { this.client = client; } + + public String getThreadpool() { + return threadpool; + } + + public void setThreadpool(String threadpool) { + this.threadpool = threadpool; + } + + public Boolean getDefault() { + return isDefault; + } + + public Integer getCorethreads() { + return corethreads; + } + + public void setCorethreads(Integer corethreads) { + this.corethreads = corethreads; + } + + public Integer getThreads() { + return threads; + } + + public void setThreads(Integer threads) { + this.threads = threads; + } + + public Integer getQueues() { + return queues; + } + + public void setQueues(Integer queues) { + this.queues = queues; + } } \ No newline at end of file diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ConsumerConfigTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ConsumerConfigTest.java index a0b8ed75d1e..b9a1a9a8827 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ConsumerConfigTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ConsumerConfigTest.java @@ -50,4 +50,32 @@ public void testClient() throws Exception { consumer.setClient("client"); assertThat(consumer.getClient(), equalTo("client")); } + + @Test + public void testThreadpool() throws Exception { + ConsumerConfig consumer = new ConsumerConfig(); + consumer.setThreadpool("fixed"); + assertThat(consumer.getThreadpool(), equalTo("fixed")); + } + + @Test + public void testCorethreads() throws Exception { + ConsumerConfig consumer = new ConsumerConfig(); + consumer.setCorethreads(10); + assertThat(consumer.getCorethreads(), equalTo(10)); + } + + @Test + public void testThreads() throws Exception { + ConsumerConfig consumer = new ConsumerConfig(); + consumer.setThreads(20); + assertThat(consumer.getThreads(), equalTo(20)); + } + + @Test + public void testQueues() throws Exception { + ConsumerConfig consumer = new ConsumerConfig(); + consumer.setQueues(5); + assertThat(consumer.getQueues(), equalTo(5)); + } } diff --git a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/compat/dubbo.xsd b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/compat/dubbo.xsd index 209a8d489e6..30558cc7afe 100644 --- a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/compat/dubbo.xsd +++ b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/compat/dubbo.xsd @@ -708,6 +708,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd index 42132282212..adaa9369dfb 100644 --- a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd +++ b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd @@ -708,6 +708,26 @@ + + + + + + + + + + + + + + + + + + + +