From 60c835db129d04999ebe560241462e1e68bfb57c Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Thu, 25 Feb 2021 14:43:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E6=95=B0=E7=BA=BF=E7=A8=8B=E5=A4=84?= =?UTF-8?q?=E7=90=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/telpo/iotgateway/listener/IotMessageListener.java | 8 ++++---- .../java/com/telpo/iotgateway/server/IotSubscribe.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java b/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java index ef360ae..9eabc5d 100644 --- a/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java +++ b/src/main/java/com/telpo/iotgateway/listener/IotMessageListener.java @@ -77,10 +77,10 @@ public class IotMessageListener implements MessageListener { String content = new String(body); String topic = message.getStringProperty("topic"); String messageId = message.getStringProperty("messageId"); -// log.info("receive message" -// + ", topic = " + topic -// + ", messageId = " + messageId -// + ", content = " + content); + log.info("receive message" + + ", topic = " + topic + + ", messageId = " + messageId + + ", content = " + content); count.getAndIncrement(); } catch (Exception e) { diff --git a/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java b/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java index 19cdd32..7bcb3ed 100644 --- a/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java +++ b/src/main/java/com/telpo/iotgateway/server/IotSubscribe.java @@ -51,8 +51,8 @@ public class IotSubscribe { // 执行单元线程池 private final static ExecutorService executorService = new ThreadPoolExecutor( - Runtime.getRuntime().availableProcessors(), - Runtime.getRuntime().availableProcessors() * 2, 60, TimeUnit.SECONDS, + Runtime.getRuntime().availableProcessors() - 1, + (Runtime.getRuntime().availableProcessors() -1)* 2, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>(50000)); // Jms连接侦听 private static JmsConnectionListener myJmsConnectionListener = new IotJmsConnectionListener();