From 1060bdd8032f813775f120aa207dbe691c459c85 Mon Sep 17 00:00:00 2001 From: 3y Date: Mon, 2 Sep 2024 22:02:33 +0800 Subject: [PATCH] =?UTF-8?q?fix#=20=E6=B6=88=E8=B4=B9=E7=AB=AF=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=8A=A8=E6=80=81=E7=BA=BF=E7=A8=8B=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../austin/handler/config/HandlerThreadPoolConfig.java | 2 +- .../com/java3y/austin/handler/pending/TaskPendingHolder.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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); }