How to solve "kafka-coordinator-heartbeat-thread" exception when a kafka consumer is re-started again after some time?

Viewed 292

I am running a Kafka consumer jar file on a Linux system. I am not running the application as a service and also my PC is not running for 24 hours. Whenever i start the Kafka consumer, i am receiving previous messages from Kafka Broker (AUTO_OFFSET_RESET_CONFIG -> "latest"). But some time later i get a "Kafka-coordinator-heartbeat-thread, sending LeaveGroup request to coordinator " exception.

It says "due to consumer poll timeout has expired. This means the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time processing messages. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records."

I have also increased the "max.poll.interval.ms" to 300000 ms (5 mins), "max.poll.records" to 500, "session.timeout.ms" to 10000 ms "heartbeat.interval.ms" to 3000 ms but still i am getting the same error.

If i run the Kafka consumer multiple times to receive all the messages from Kafka broker, which were sent by the Kafka producer when the Kafka consumer was offline, then it works normally. But if i run the Kafka consumer before receiving all previous messages from the broker then i get the same exception.

Can somebody please provide me some suggestions and recommendations for this problem? Any help would be really appreciated. Thank you

Best Regards,

0 Answers
Related