From c9fda0f30cc24b49543524c08ee1d08752938d8c Mon Sep 17 00:00:00 2001 From: zhou-hao Date: Mon, 21 Sep 2020 17:11:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmqtt=20=E8=87=AA=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=8F=AF=E8=83=BD=E5=A4=B1=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../network/mqtt/gateway/device/MqttServerDeviceGateway.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jetlinks-components/network-component/mqtt-component/src/main/java/org/jetlinks/community/network/mqtt/gateway/device/MqttServerDeviceGateway.java b/jetlinks-components/network-component/mqtt-component/src/main/java/org/jetlinks/community/network/mqtt/gateway/device/MqttServerDeviceGateway.java index 35682579..a618d11f 100644 --- a/jetlinks-components/network-component/mqtt-component/src/main/java/org/jetlinks/community/network/mqtt/gateway/device/MqttServerDeviceGateway.java +++ b/jetlinks-components/network-component/mqtt-component/src/main/java/org/jetlinks/community/network/mqtt/gateway/device/MqttServerDeviceGateway.java @@ -241,7 +241,9 @@ class MqttServerDeviceGateway implements DeviceGateway, MonitorSupportDeviceGate if (anotherSession == null) { return registry .getDevice(msg.getDeviceId()) - .flatMap(device -> handleMessage(device.getDeviceId(), device, msg, session)); + .map(device -> handleMessage(device.getDeviceId(), device, msg, session)) + .defaultIfEmpty(Mono.defer(()->handleMessage(msg.getDeviceId(), operator, msg, session))) + .flatMap(Function.identity()); } } }