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