diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/config/HandlerThreadPoolConfig.java b/austin-handler/src/main/java/com/java3y/austin/handler/config/HandlerThreadPoolConfig.java index bb1b988..ea785ea 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/config/HandlerThreadPoolConfig.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/config/HandlerThreadPoolConfig.java @@ -15,7 +15,7 @@ import java.util.concurrent.TimeUnit; */ public class HandlerThreadPoolConfig { - private static final String PRE_FIX = "austin."; + public static final String PRE_FIX = "austin."; private HandlerThreadPoolConfig() { diff --git a/austin-handler/src/main/java/com/java3y/austin/handler/pending/TaskPendingHolder.java b/austin-handler/src/main/java/com/java3y/austin/handler/pending/TaskPendingHolder.java index 19aec62..a8fb389 100644 --- a/austin-handler/src/main/java/com/java3y/austin/handler/pending/TaskPendingHolder.java +++ b/austin-handler/src/main/java/com/java3y/austin/handler/pending/TaskPendingHolder.java @@ -1,5 +1,6 @@ package com.java3y.austin.handler.pending; +import com.dtp.core.DtpRegistry; import com.dtp.core.thread.DtpExecutor; import com.java3y.austin.handler.config.HandlerThreadPoolConfig; import com.java3y.austin.handler.utils.GroupIdMappingUtils; @@ -27,7 +28,6 @@ public class TaskPendingHolder { private static List groupIds = GroupIdMappingUtils.getAllGroupIds(); @Autowired private ThreadPoolUtils threadPoolUtils; - private Map holder = new HashMap<>(32); /** * 给每个渠道,每种消息类型初始化一个线程池 @@ -43,7 +43,6 @@ public class TaskPendingHolder { DtpExecutor executor = HandlerThreadPoolConfig.getExecutor(groupId); threadPoolUtils.register(executor); - holder.put(groupId, executor); } } @@ -54,7 +53,7 @@ public class TaskPendingHolder { * @return */ public ExecutorService route(String groupId) { - return holder.get(groupId); + return DtpRegistry.getExecutor(HandlerThreadPoolConfig.PRE_FIX + groupId); }