Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhou-hao 2021-01-12 10:17:33 +08:00
commit 7c22ccd3da
1 changed files with 28 additions and 28 deletions

View File

@ -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;
})