Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
7c22ccd3da
|
|
@ -158,6 +158,7 @@ class MqttServerDeviceGateway implements DeviceGateway, MonitorSupportDeviceGate
|
|||
MqttConnection connection) {
|
||||
return Mono
|
||||
.fromCallable(() -> {
|
||||
try {
|
||||
String deviceId = device.getDeviceId();
|
||||
if (resp.isSuccess()) {
|
||||
counter.increment();
|
||||
|
|
@ -181,15 +182,14 @@ class MqttServerDeviceGateway implements DeviceGateway, MonitorSupportDeviceGate
|
|||
gatewayMonitor.disconnected();
|
||||
gatewayMonitor.totalConnection(counter.sum());
|
||||
});
|
||||
try {
|
||||
return Tuples.of(connection.accept(), device, newSession);
|
||||
} catch (IllegalStateException ignore) {
|
||||
|
||||
}
|
||||
} else {
|
||||
log.warn("MQTT客户端认证[{}]失败:{}", deviceId, resp.getMessage());
|
||||
connection.reject(MqttConnectReturnCode.CONNECTION_REFUSED_BAD_USER_NAME_OR_PASSWORD);
|
||||
gatewayMonitor.rejected();
|
||||
log.warn("MQTT客户端认证[{}]失败:{}", deviceId, resp.getMessage());
|
||||
}
|
||||
} catch (IllegalStateException ignore) {
|
||||
|
||||
}
|
||||
return null;
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue