Kafka client faced disconnected will reconnect again by again, anyway can disable it?

Viewed 263

The client will reconnect again by itself again, anyway I can disable it?

Should I close Kafka client?

[2022-06-30 16:17:51,332] WARN [Consumer clientId=consumer-xxx, groupId=xxx] Bootstrap broker xxx:xxx (id: -1 rack: null) disconnected (org.apache.kafka.clients.NetworkClient)
[2022-06-30 16:17:52,387] WARN [Consumer clientId=consumer-pg-hudi001_5-1, groupId=pg-hudi001_5] Connection to node -1 (xxx) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
1 Answers

The consumer will constantly poll and periodically refresh its metadata about what brokers are available from the cluster Controller.

The only way to stop it from trying to connect is to close() the consumer, yes.

Related