You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/07/24 04:06:38 UTC

[GitHub] tswstarplanet commented on a change in pull request #2114: Dubbo-2013

tswstarplanet commented on a change in pull request #2114: Dubbo-2013
URL: https://github.com/apache/incubator-dubbo/pull/2114#discussion_r204618357
 
 

 ##########
 File path: dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java
 ##########
 @@ -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);
 
 Review comment:
   Ok, because I found that when ReferenceConfig integrate the configuration of ConsumerConfig, it will add the prefix "default.", so the "threadpool" property of <dubbo:consumer ../> will change to "default.thread" parameter in the URL.
   So, I think we have two ways to optimize the issue.
   @chickenlj First, take some special process when integrate the "threadpool" property of ConsumerConfig to ReferenceConfig to wipe off the prefix "default.";
   Second is just the method that this sumbit uses.
   If the second way is not so good, I think we can take the second one.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org