Enhance reconnection mechanism of agent kafka reporter plugin. (#6855)

This commit is contained in:
Ax1an 2021-04-28 07:45:42 +08:00 committed by GitHub
parent 36c61fcfa9
commit ea0390e454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -127,6 +127,7 @@ public class KafkaProducerManager implements BootService, Runnable {
producer = new KafkaProducer<>(properties, new StringSerializer(), new BytesSerializer());
} catch (Exception e) {
LOGGER.error(e, "connect to kafka cluster '{}' failed", KafkaReporterPluginConfig.Plugin.Kafka.BOOTSTRAP_SERVERS);
return;
}
//notify listeners to send data if no exception been throw
notifyListeners(KafkaConnectionStatus.CONNECTED);