You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shenyu.apache.org by GitBox <gi...@apache.org> on 2021/06/18 21:25:17 UTC

[GitHub] [incubator-shenyu] tydhot commented on a change in pull request #1632: fix (admin,client): Add the thread pool name to the thread pool of shenyu-client

tydhot commented on a change in pull request #1632:
URL: https://github.com/apache/incubator-shenyu/pull/1632#discussion_r654249672



##########
File path: shenyu-client/shenyu-client-sofa/src/main/java/org/apache/shenyu/client/sofa/SofaServiceBeanPostProcessor.java
##########
@@ -75,7 +76,8 @@ public SofaServiceBeanPostProcessor(final ShenyuRegisterCenterConfig config, fin
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()
+                .setNameFormat("sofa-client-thread-pool-%d").build());

Review comment:
       if u want to add poll name, I think u must add prefix like 'shenyu-' first to avoid misunderstanding .

##########
File path: shenyu-client/shenyu-client-sofa/src/main/java/org/apache/shenyu/client/sofa/SofaServiceBeanPostProcessor.java
##########
@@ -75,7 +76,8 @@ public SofaServiceBeanPostProcessor(final ShenyuRegisterCenterConfig config, fin
         this.appName = appName;
         this.host = props.getProperty("host");
         this.port = props.getProperty("port");
-        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
+        executorService = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder()
+                .setNameFormat("sofa-client-thread-pool-%d").build());

Review comment:
       if u want to add pool name, I think u must add prefix like 'shenyu-' first to avoid misunderstanding .




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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