Integration / Apache Kafka Interview questions
What happens when a consumer in a group fails to send a heartbeat in time?
Each consumer in a group periodically sends a heartbeat to the group coordinator (a role held by one of the brokers) to signal it's still alive and processing. If a consumer misses heartbeats for longer than session.timeout.ms, the coordinator considers it dead and removes it from the group, triggering a rebalance that redistributes its assigned partitions among the remaining live consumers.
session.timeout.ms=45000 heartbeat.interval.ms=3000 max.poll.interval.ms=300000
A separate, often-confused setting is max.poll.interval.ms: even if heartbeats (sent on a background thread in modern Kafka clients) keep arriving on time, a consumer that takes too long between calls to poll() — because its processing logic is stuck or too slow — is also considered as having left the group, since Kafka can no longer be sure it's actually making progress on records already handed to it. This is the most common cause of unexpected rebalances in production: slow per-record processing exceeding max.poll.interval.ms, not an actual network or process failure.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
