Browse Source
Merge pull request #13709 from smatvienko-tb/hotfix/MqttClient-reduce-log-severity-for-reconnect
Reduced log severity to debug for Scheduling reconnect message to avoid log flood under high-load. Logs are made more informative.
pull/13735/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
2 deletions
-
netty-mqtt/src/main/java/org/thingsboard/mqtt/MqttClientImpl.java
|
|
|
@ -192,14 +192,14 @@ final class MqttClientImpl implements MqttClient { |
|
|
|
} |
|
|
|
|
|
|
|
private void scheduleConnectIfRequired(String host, int port, boolean reconnect) { |
|
|
|
log.trace("[{}] Scheduling connect to server, isReconnect - {}", channel != null ? channel.id() : "UNKNOWN", reconnect); |
|
|
|
log.trace("[{}][{}][{}] Scheduling connect to server, isReconnect - {}", host, port, channel != null ? channel.id() : "UNKNOWN", reconnect); |
|
|
|
if (clientConfig.isReconnect() && !disconnected) { |
|
|
|
if (reconnect) { |
|
|
|
this.reconnect = true; |
|
|
|
} |
|
|
|
|
|
|
|
final long nextReconnectDelay = reconnectStrategy.getNextReconnectDelay(); |
|
|
|
log.info("[{}] Scheduling reconnect in [{}] sec", channel != null ? channel.id() : "UNKNOWN", nextReconnectDelay); |
|
|
|
log.debug("[{}][{}][{}] Scheduling reconnect in [{}] sec", host, port, channel != null ? channel.id() : "UNKNOWN", nextReconnectDelay); |
|
|
|
eventLoop.schedule((Runnable) () -> connect(host, port, reconnect), nextReconnectDelay, TimeUnit.SECONDS); |
|
|
|
} |
|
|
|
} |
|
|
|
|