作者 crossoverJie

:sparkles: Introducing new features.新增接口回调完成

... ... @@ -74,7 +74,7 @@ public class BeanConfig {
public ThreadPoolExecutor buildCallerThread(){
BlockingQueue<Runnable> queue = new LinkedBlockingQueue(queueSize);
ThreadFactory product = new ThreadFactoryBuilder()
.setNameFormat("product-%d")
.setNameFormat("msg-callback-%d")
.setDaemon(true)
.build();
ThreadPoolExecutor productExecutor = new ThreadPoolExecutor(poolSize, poolSize, 1, TimeUnit.MILLISECONDS, queue,product);
... ... @@ -88,7 +88,6 @@ public class BeanConfig {
@Bean
public MsgHandleCaller buildCaller(){
MsgHandleCaller caller = new MsgHandleCaller(msg -> {
LOGGER.warn("caller msg=[{}]" ,msg);
}) ;
return caller ;
... ...
... ... @@ -25,9 +25,9 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt
private final static Logger LOGGER = LoggerFactory.getLogger(CIMClientHandle.class);
private MsgHandleCaller caller = SpringBeanFactory.getBean(MsgHandleCaller.class);
private MsgHandleCaller caller ;
private ThreadPoolExecutor threadPoolExecutor = SpringBeanFactory.getBean("callBackThreadPool",ThreadPoolExecutor.class) ;;
private ThreadPoolExecutor threadPoolExecutor ;
@Override
... ... @@ -73,8 +73,9 @@ public class CIMClientHandle extends SimpleChannelInboundHandler<CIMResponseProt
* @param msg
*/
private void callBackMsg(String msg) {
threadPoolExecutor = SpringBeanFactory.getBean("callBackThreadPool",ThreadPoolExecutor.class) ;
threadPoolExecutor.execute(() -> {
caller = SpringBeanFactory.getBean(MsgHandleCaller.class) ;
caller.getMsgHandleListener().handle(msg);
});
... ...
... ... @@ -15,7 +15,7 @@ public enum StatusEnum {
FAIL("4000", "失败"),
/** 重复登录 */
REPEAT_LOGIN("5000", "重复登录"),
REPEAT_LOGIN("5000", "账号重复登录,请退出一个账号!"),
/** 请求限流 */
REQUEST_LIMIT("6000", "请求限流"),
... ...