From 207fb86b408526f7a21ebf60abacdd35cd89156d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= <1101766085@qq.com> Date: Mon, 16 Aug 2021 16:32:48 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20MqttServerTest=20=E5=85=B3?= =?UTF-8?q?=E9=97=AD=20websocket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/net/dreamlu/iot/mqtt/mica/MqttServerTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mica-mqtt-spring-boot-example/src/main/java/net/dreamlu/iot/mqtt/mica/MqttServerTest.java b/mica-mqtt-spring-boot-example/src/main/java/net/dreamlu/iot/mqtt/mica/MqttServerTest.java index a7add6b..ff9b75b 100644 --- a/mica-mqtt-spring-boot-example/src/main/java/net/dreamlu/iot/mqtt/mica/MqttServerTest.java +++ b/mica-mqtt-spring-boot-example/src/main/java/net/dreamlu/iot/mqtt/mica/MqttServerTest.java @@ -43,6 +43,8 @@ public class MqttServerTest { .port(3883) // 默认为: 8092(mqtt 默认最大消息大小),为了降低内存可以减小小此参数,如果消息过大 t-io 会尝试解析多次(建议根据实际业务情况而定) .readBufferSize(512) + // 关闭 websocket,避免和 spring boot 启动的冲突 + .websocketEnable(false) .messageListener((clientId, topic, mqttQoS, payload) -> { logger.info("clientId:{} topic:{} mqttQoS:{} message:{}", clientId, topic, mqttQoS, ByteBufferUtil.toString(payload)); }) -- GitLab