优化MQTT网关

This commit is contained in:
zhou-hao 2020-08-05 09:48:46 +08:00
parent e094a6ae18
commit 35b088388e
1 changed files with 3 additions and 1 deletions

View File

@ -127,7 +127,9 @@ class MqttServerDeviceGateway implements DeviceGateway, MonitorSupportDeviceGate
if (!deviceId.equals(device.getDeviceId())) {
return registry
.getDevice(deviceId)
.map(operator -> Tuples.of(operator, resp, connection));
.map(operator -> Tuples.of(operator, resp, connection))
.switchIfEmpty(Mono.fromRunnable(() -> connection.reject(MqttConnectReturnCode.CONNECTION_REFUSED_IDENTIFIER_REJECTED)))
;
}
return Mono.just(Tuples.of(device, resp, connection));
})