private final ThreadPoolExecutor handleExecutor = new ThreadPoolExecutor( 3, 5, 5000L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), new ThreadFactoryBuilder().setNameFormat("MsgCenterHandle-%d").build());
handleExecutor.execute(() -> { try { if (res > 0) { // 添加未读数量 msgCenterService.addUnReadCount(msgTypeId, userIdList); } } catch (Exception e) { log.error("消息盒子: 消息入库异常. {}", e, e); } });
标签:Java,未读,线程,简单,new,handleExecutor,ThreadPoolExecutor From: https://www.cnblogs.com/zhangqb/p/17474892.html