正在显示
3 个修改的文件
包含
6 行增加
和
6 行删除
| @@ -74,7 +74,7 @@ public class BeanConfig { | @@ -74,7 +74,7 @@ public class BeanConfig { | ||
| 74 | public ThreadPoolExecutor buildCallerThread(){ | 74 | public ThreadPoolExecutor buildCallerThread(){ |
| 75 | BlockingQueue<Runnable> queue = new LinkedBlockingQueue(queueSize); | 75 | BlockingQueue<Runnable> queue = new LinkedBlockingQueue(queueSize); |
| 76 | ThreadFactory product = new ThreadFactoryBuilder() | 76 | ThreadFactory product = new ThreadFactoryBuilder() |
| 77 | - .setNameFormat("product-%d") | 77 | + .setNameFormat("msg-callback-%d") |
| 78 | .setDaemon(true) | 78 | .setDaemon(true) |
| 79 | .build(); | 79 | .build(); |
| 80 | ThreadPoolExecutor productExecutor = new ThreadPoolExecutor(poolSize, poolSize, 1, TimeUnit.MILLISECONDS, queue,product); | 80 | ThreadPoolExecutor productExecutor = new ThreadPoolExecutor(poolSize, poolSize, 1, TimeUnit.MILLISECONDS, queue,product); |
| @@ -88,7 +88,6 @@ public class BeanConfig { | @@ -88,7 +88,6 @@ public class BeanConfig { | ||
| 88 | @Bean | 88 | @Bean |
| 89 | public MsgHandleCaller buildCaller(){ | 89 | public MsgHandleCaller buildCaller(){ |
| 90 | MsgHandleCaller caller = new MsgHandleCaller(msg -> { | 90 | MsgHandleCaller caller = new MsgHandleCaller(msg -> { |
| 91 | - LOGGER.warn("caller msg=[{}]" ,msg); | ||
| 92 | }) ; | 91 | }) ; |
| 93 | 92 | ||
| 94 | return caller ; | 93 | return caller ; |
| @@ -25,9 +25,9 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt | @@ -25,9 +25,9 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt | ||
| 25 | 25 | ||
| 26 | private final static Logger LOGGER = LoggerFactory.getLogger(CIMClientHandle.class); | 26 | private final static Logger LOGGER = LoggerFactory.getLogger(CIMClientHandle.class); |
| 27 | 27 | ||
| 28 | - private MsgHandleCaller caller = SpringBeanFactory.getBean(MsgHandleCaller.class); | 28 | + private MsgHandleCaller caller ; |
| 29 | 29 | ||
| 30 | - private ThreadPoolExecutor threadPoolExecutor = SpringBeanFactory.getBean("callBackThreadPool",ThreadPoolExecutor.class) ;; | 30 | + private ThreadPoolExecutor threadPoolExecutor ; |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | @Override | 33 | @Override |
| @@ -73,8 +73,9 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt | @@ -73,8 +73,9 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt | ||
| 73 | * @param msg | 73 | * @param msg |
| 74 | */ | 74 | */ |
| 75 | private void callBackMsg(String msg) { | 75 | private void callBackMsg(String msg) { |
| 76 | - | 76 | + threadPoolExecutor = SpringBeanFactory.getBean("callBackThreadPool",ThreadPoolExecutor.class) ; |
| 77 | threadPoolExecutor.execute(() -> { | 77 | threadPoolExecutor.execute(() -> { |
| 78 | + caller = SpringBeanFactory.getBean(MsgHandleCaller.class) ; | ||
| 78 | caller.getMsgHandleListener().handle(msg); | 79 | caller.getMsgHandleListener().handle(msg); |
| 79 | }); | 80 | }); |
| 80 | 81 |
| @@ -15,7 +15,7 @@ public enum StatusEnum { | @@ -15,7 +15,7 @@ public enum StatusEnum { | ||
| 15 | FAIL("4000", "失败"), | 15 | FAIL("4000", "失败"), |
| 16 | 16 | ||
| 17 | /** 重复登录 */ | 17 | /** 重复登录 */ |
| 18 | - REPEAT_LOGIN("5000", "重复登录"), | 18 | + REPEAT_LOGIN("5000", "账号重复登录,请退出一个账号!"), |
| 19 | 19 | ||
| 20 | /** 请求限流 */ | 20 | /** 请求限流 */ |
| 21 | REQUEST_LIMIT("6000", "请求限流"), | 21 | REQUEST_LIMIT("6000", "请求限流"), |
-
请 注册 或 登录 后发表评论