From b29036144b46896287ef48f3733eda4991c2f7f7 Mon Sep 17 00:00:00 2001 From: soul-walker Date: Sat, 11 May 2024 14:28:50 +0800 Subject: [PATCH] =?UTF-8?q?MQTT=E6=B7=BB=E5=8A=A0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/message/MqttBroker.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/message/MqttBroker.ts b/src/message/MqttBroker.ts index 990ee26..141afcc 100644 --- a/src/message/MqttBroker.ts +++ b/src/message/MqttBroker.ts @@ -52,6 +52,7 @@ export class MqttMsgClient extends MessageClient { this.emit('error', error); }); this.cli.on('message', (topic, message) => { + console.debug('MQTT 收到消息', topic, message); const handle = this.subMsgHandler.get(topic); if (handle) { if (this.options.protocol === 'json') { @@ -61,6 +62,8 @@ export class MqttMsgClient extends MessageClient { // 字节流 handle(message); } + } else { + console.warn('未找到订阅的消息处理器', topic); } }); } catch (err) {