Reduced log severity to debug for Scheduling reconnect message to avoid log flood under high-load. Logs are made more informative.

This commit is contained in:
Sergey Matvienko 2025-07-12 10:09:09 +02:00
parent b656f029ac
commit 480b89c11c

View File

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