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) {