From 6b0bd1aaaa7c610450f065c7e257185b2e9d61b5 Mon Sep 17 00:00:00 2001 From: wts <896517973@qq.com> Date: Mon, 28 May 2018 10:03:42 +0800 Subject: [PATCH 01/10] =?UTF-8?q?parameter=E6=98=AF=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=B3=A8=E8=A7=A3=E5=AF=B9=E8=B1=A1=EF=BC=8C=E6=AD=A4=E5=A4=84?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E5=AE=83=E7=9A=84key=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=AE=9E=E9=99=85=E7=94=A8=E5=A4=84=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E5=88=A0=E9=99=A4=E8=BF=99=E4=B8=80=E8=A1=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/alibaba/dubbo/config/AbstractConfig.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractConfig.java index 84ad29e7bbe..f09c569d258 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/AbstractConfig.java @@ -257,7 +257,6 @@ && isPrimitive(method.getReturnType())) { if (parameter == null || !parameter.attribute()) continue; String key; - parameter.key(); if (parameter.key().length() > 0) { key = parameter.key(); } else { From 20644bc965e5fcb8bc0f19e9a361ce62a521c48b Mon Sep 17 00:00:00 2001 From: wts <896517973@qq.com> Date: Tue, 26 Jun 2018 13:06:14 +0800 Subject: [PATCH 02/10] fix the potential null pointer exception --- .../dubbo/rpc/cluster/directory/StaticDirectory.java | 10 +++++++++- .../rpc/cluster/directory/StaticDirectoryTest.java | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java index 47a0d12bc7d..75fe60a5e2c 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java @@ -17,6 +17,7 @@ package org.apache.dubbo.rpc.cluster.directory; import org.apache.dubbo.common.URL; +import org.apache.dubbo.common.utils.CollectionUtils; import org.apache.dubbo.rpc.Invocation; import org.apache.dubbo.rpc.Invoker; import org.apache.dubbo.rpc.RpcException; @@ -53,7 +54,14 @@ public StaticDirectory(URL url, List> invokers, List routers) @Override public Class getInterface() { - return invokers.get(0).getInterface(); + if (CollectionUtils.isEmpty(invokers)) { + throw new IllegalArgumentException("invokers == null"); + } + Invoker invoker = invokers.get(0); + if (invoker == null) { + throw new NullPointerException("invokes[0] == null"); + } + return invoker.getInterface(); } @Override diff --git a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java index 0bf0562fd73..62d9b4b7a8c 100644 --- a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java +++ b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java @@ -55,6 +55,7 @@ public void testStaticDirectory() { invokers.add(invoker3); List> filteredInvokers = router.route(invokers, URL.valueOf("consumer://" + NetUtils.getLocalHost() + "/com.foo.BarService"), new RpcInvocation()); StaticDirectory staticDirectory = new StaticDirectory(filteredInvokers); + staticDirectory.getInterface(); Boolean isAvailable = staticDirectory.isAvailable(); Assert.assertTrue(!isAvailable); List newInvokers = staticDirectory.list(new MockDirInvocation()); From a93a5db4cb5fbe00421c8a1a3222c7cd21770119 Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Tue, 17 Jul 2018 22:22:01 +0800 Subject: [PATCH 03/10] Add the corethreads tag to the complex tab --- .../java/org/apache/dubbo/config/ProtocolConfig.java | 11 +++++++++++ .../org/apache/dubbo/config/ProtocolConfigTest.java | 7 +++++++ .../src/main/resources/META-INF/dubbo.xsd | 5 +++++ 3 files changed, 23 insertions(+) diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ProtocolConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ProtocolConfig.java index c2e4210181f..3ae33291adc 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ProtocolConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ProtocolConfig.java @@ -54,6 +54,9 @@ public class ProtocolConfig extends AbstractConfig { // thread pool private String threadpool; + // thread pool core thread size + private Integer corethreads; + // thread pool size (fixed size) private Integer threads; @@ -207,6 +210,14 @@ public void setThreadpool(String threadpool) { this.threadpool = threadpool; } + public Integer getCorethreads() { + return corethreads; + } + + public void setCorethreads(Integer corethreads) { + this.corethreads = corethreads; + } + public Integer getThreads() { return threads; } diff --git a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ProtocolConfigTest.java b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ProtocolConfigTest.java index 754525629e1..04c5a4315a4 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ProtocolConfigTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ProtocolConfigTest.java @@ -88,6 +88,13 @@ public void testPath() throws Exception { assertThat(protocol.getContextpath(), equalTo("path")); } + @Test + public void testCorethreads() throws Exception { + ProtocolConfig protocol = new ProtocolConfig(); + protocol.setCorethreads(10); + assertThat(protocol.getCorethreads(), is(10)); + } + @Test public void testThreads() throws Exception { ProtocolConfig protocol = new ProtocolConfig(); 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 a2cd6b99310..42132282212 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 @@ -789,6 +789,11 @@ + + + + + From e8e2a2dc707823efa8b8327e6bcfdb01a3026222 Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Tue, 17 Jul 2018 22:50:15 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=8D=E7=A1=AE?= =?UTF-8?q?=E5=AE=9A=E6=98=AF=E5=90=A6=E6=9C=89=E9=97=AE=E9=A2=98=E7=9A=84?= =?UTF-8?q?issue=E7=9A=84=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dubbo/rpc/cluster/directory/StaticDirectory.java | 9 +-------- .../dubbo/rpc/cluster/directory/StaticDirectoryTest.java | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java index 75fe60a5e2c..d84ff685d03 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java @@ -54,14 +54,7 @@ public StaticDirectory(URL url, List> invokers, List routers) @Override public Class getInterface() { - if (CollectionUtils.isEmpty(invokers)) { - throw new IllegalArgumentException("invokers == null"); - } - Invoker invoker = invokers.get(0); - if (invoker == null) { - throw new NullPointerException("invokes[0] == null"); - } - return invoker.getInterface(); + return invokers.get(0).getInterface(); } @Override diff --git a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java index 62d9b4b7a8c..0bf0562fd73 100644 --- a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java +++ b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectoryTest.java @@ -55,7 +55,6 @@ public void testStaticDirectory() { invokers.add(invoker3); List> filteredInvokers = router.route(invokers, URL.valueOf("consumer://" + NetUtils.getLocalHost() + "/com.foo.BarService"), new RpcInvocation()); StaticDirectory staticDirectory = new StaticDirectory(filteredInvokers); - staticDirectory.getInterface(); Boolean isAvailable = staticDirectory.isAvailable(); Assert.assertTrue(!isAvailable); List newInvokers = staticDirectory.list(new MockDirInvocation()); From 31a9164dd1253d04bba9d2a35dc007a192b12d77 Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Tue, 17 Jul 2018 22:55:25 +0800 Subject: [PATCH 05/10] delete the unnecessary import --- .../org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java index d84ff685d03..47a0d12bc7d 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java @@ -17,7 +17,6 @@ package org.apache.dubbo.rpc.cluster.directory; import org.apache.dubbo.common.URL; -import org.apache.dubbo.common.utils.CollectionUtils; import org.apache.dubbo.rpc.Invocation; import org.apache.dubbo.rpc.Invoker; import org.apache.dubbo.rpc.RpcException; From 6796da2beab7f1999ff9c2e95383f839a42e674d Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Fri, 20 Jul 2018 01:44:53 +0800 Subject: [PATCH 06/10] add a tag "threadpool" to the complex tag "consumer" --- .../java/org/apache/dubbo/config/ConsumerConfig.java | 11 +++++++++++ .../src/main/resources/META-INF/dubbo.xsd | 5 +++++ .../dubbo/remoting/transport/AbstractClient.java | 11 +++++++---- 3 files changed, 23 insertions(+), 4 deletions(-) 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..2757842b036 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,9 @@ public class ConsumerConfig extends AbstractReferenceConfig { // networking framework client uses: netty, mina, etc. private String client; + // client thread pool type: cached, fixed, limit + private String threadpool; + @Override public void setTimeout(Integer timeout) { super.setTimeout(timeout); @@ -56,4 +59,12 @@ public String getClient() { public void setClient(String client) { this.client = client; } + + public String getThreadpool() { + return threadpool; + } + + public void setThreadpool(String threadpool) { + this.threadpool = threadpool; + } } \ No newline at end of file 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..1754475d6cb 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,11 @@ + + + + + diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java index dd75e5b311e..83fbdbe1b1f 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java @@ -23,9 +23,7 @@ import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; import org.apache.dubbo.common.store.DataStore; -import org.apache.dubbo.common.utils.ExecutorUtil; -import org.apache.dubbo.common.utils.NamedThreadFactory; -import org.apache.dubbo.common.utils.NetUtils; +import org.apache.dubbo.common.utils.*; import org.apache.dubbo.remoting.Channel; import org.apache.dubbo.remoting.ChannelHandler; import org.apache.dubbo.remoting.Client; @@ -113,7 +111,12 @@ public AbstractClient(URL url, ChannelHandler handler) throws RemotingException protected static ChannelHandler wrapChannelHandler(URL url, ChannelHandler handler) { url = ExecutorUtil.setThreadName(url, CLIENT_THREAD_POOL_NAME); - url = url.addParameterIfAbsent(Constants.THREADPOOL_KEY, Constants.DEFAULT_CLIENT_THREADPOOL); + String key = Constants.DEFAULT_KEY + Constants.HIDE_KEY_PREFIX + Constants.THREADPOOL_KEY; + String threadpool = url.getParameter(key); + if (StringUtils.isNotEmpty(threadpool)) { + url = url.removeParameter(key); + } + url = url.addParameterIfAbsent(Constants.THREADPOOL_KEY, StringUtils.isNotEmpty(threadpool) ? threadpool : Constants.DEFAULT_CLIENT_THREADPOOL); return ChannelHandlers.wrap(handler, url); } From 7e70a685725882e04a122bdbb7be1025a05141f9 Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Fri, 20 Jul 2018 23:22:11 +0800 Subject: [PATCH 07/10] add a tag "threadpool" to the complex tag "consumer"; add the test code --- .../java/org/apache/dubbo/config/ConsumerConfigTest.java | 7 +++++++ 1 file changed, 7 insertions(+) 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..25640d2bc8d 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,11 @@ public void testClient() throws Exception { consumer.setClient("client"); assertThat(consumer.getClient(), equalTo("client")); } + + @Test + public void testThreadpool() throws Exception { + ConsumerConfig consumer = new ConsumerConfig(); + consumer.setClient("fixed"); + assertThat(consumer.getThreadpool(), equalTo("fixed")); + } } From 13166236bd085e2203206964bed6274989af31aa Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Fri, 20 Jul 2018 23:31:34 +0800 Subject: [PATCH 08/10] add a tag "threadpool" to the complex tag "consumer"; note --- .../src/main/java/org/apache/dubbo/config/ConsumerConfig.java | 2 +- .../dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 2757842b036..b8e43cad771 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,7 +31,7 @@ public class ConsumerConfig extends AbstractReferenceConfig { // networking framework client uses: netty, mina, etc. private String client; - // client thread pool type: cached, fixed, limit + // client thread pool type: cached, fixed, limit, eager private String threadpool; @Override 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 1754475d6cb..06ae7a45e21 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 @@ -710,7 +710,7 @@ - + From 58980c3ea8e8e32d8952f468cabfc752be3cfbfa Mon Sep 17 00:00:00 2001 From: wts <896517973@qq.com> Date: Sat, 21 Jul 2018 11:01:33 +0800 Subject: [PATCH 09/10] fix an error in unit test --- .../test/java/org/apache/dubbo/config/ConsumerConfigTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 25640d2bc8d..c6dac9f0311 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 @@ -54,7 +54,7 @@ public void testClient() throws Exception { @Test public void testThreadpool() throws Exception { ConsumerConfig consumer = new ConsumerConfig(); - consumer.setClient("fixed"); + consumer.setThreadpool("fixed"); assertThat(consumer.getThreadpool(), equalTo("fixed")); } } From 889060b5e2788145d0a1e09e4948575e068af2f6 Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Wed, 25 Jul 2018 00:34:40 +0800 Subject: [PATCH 10/10] add tag 'threadpool', 'corethreads', 'threads', 'queues' to the complex tag so the consumer can config the threadpool --- .../apache/dubbo/config/ConsumerConfig.java | 39 ++++++++++++++++++- .../dubbo/config/ConsumerConfigTest.java | 21 ++++++++++ .../main/resources/META-INF/compat/dubbo.xsd | 20 ++++++++++ .../src/main/resources/META-INF/dubbo.xsd | 15 +++++++ .../remoting/transport/AbstractClient.java | 11 ++---- 5 files changed, 98 insertions(+), 8 deletions(-) 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 b8e43cad771..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,9 +31,18 @@ public class ConsumerConfig extends AbstractReferenceConfig { // networking framework client uses: netty, mina, etc. private String client; - // client thread pool type: cached, fixed, limit, eager + // 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); @@ -67,4 +76,32 @@ public String getThreadpool() { 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 c6dac9f0311..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 @@ -57,4 +57,25 @@ public void testThreadpool() throws Exception { 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 06ae7a45e21..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 @@ -713,6 +713,21 @@ + + + + + + + + + + + + + + + diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java index 83fbdbe1b1f..dd75e5b311e 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java @@ -23,7 +23,9 @@ import org.apache.dubbo.common.logger.Logger; import org.apache.dubbo.common.logger.LoggerFactory; import org.apache.dubbo.common.store.DataStore; -import org.apache.dubbo.common.utils.*; +import org.apache.dubbo.common.utils.ExecutorUtil; +import org.apache.dubbo.common.utils.NamedThreadFactory; +import org.apache.dubbo.common.utils.NetUtils; import org.apache.dubbo.remoting.Channel; import org.apache.dubbo.remoting.ChannelHandler; import org.apache.dubbo.remoting.Client; @@ -111,12 +113,7 @@ public AbstractClient(URL url, ChannelHandler handler) throws RemotingException protected static ChannelHandler wrapChannelHandler(URL url, ChannelHandler handler) { url = ExecutorUtil.setThreadName(url, CLIENT_THREAD_POOL_NAME); - String key = Constants.DEFAULT_KEY + Constants.HIDE_KEY_PREFIX + Constants.THREADPOOL_KEY; - String threadpool = url.getParameter(key); - if (StringUtils.isNotEmpty(threadpool)) { - url = url.removeParameter(key); - } - url = url.addParameterIfAbsent(Constants.THREADPOOL_KEY, StringUtils.isNotEmpty(threadpool) ? threadpool : Constants.DEFAULT_CLIENT_THREADPOOL); + url = url.addParameterIfAbsent(Constants.THREADPOOL_KEY, Constants.DEFAULT_CLIENT_THREADPOOL); return ChannelHandlers.wrap(handler, url); }