Skip to main content

How to treat kafka.common.ConsumerRebalanceFailedException?

  • December 21, 2021
  • 0 replies
  • 68 views

AkshayJadhav
StreamSets Employee
Forum|alt.badge.img

This might happen, when more Kafka consumers have the same Kafka consumer group. In some cases you can see the error message:

...kafka.common.ConsumerRebalanceFailedException...

This issue is described in Apache Kafka FAQ here:

https://cwiki.apache.org/confluence/display/KAFKA/FAQ#FAQ-Myconsumerseemstohavestopped,why?

"Consumer rebalancing fails (you will see ConsumerRebalanceFailedException): This is due to conflicts when two consumers are trying to own the same topic partition. The log will show you what caused the conflict (search for "conflict in ").

  1. If your consumer subscribes to many topics and your ZK server is busy, this could be caused by consumers not having enough time to see a consistent view of all consumers in the same group. If this is the case, try Increasing rebalance.max.retries and rebalance.backoff.ms.
  2. Another reason could be that one of the consumers is hard killed. Other consumers during rebalancing won't realize that consumer is gone after zookeeper.session.timeout.ms time. In the case, make sure that rebalance.max.retries * rebalance.backoff.ms > zookeeper.session.timeout.ms."
Did this topic help you find an answer to your question?
This topic has been closed for comments