Step 1 · The pattern
Fetch, process, commit, repeat
The consumer that owns a partition polls for a batch, works through it, commits, and polls again. Each poll restarts a countdown. A second group member stands by.
- record
- processed, not committed
- committed
In short
Rebalance storms: how it works and how it breaks
A Kafka consumer proves it is healthy in two ways. A background thread sends heartbeats, which shows the process is alive. Calling poll() for the next batch shows it is making progress. If the gap between two polls exceeds max.poll.interval.ms (five minutes by default), the consumer leaves the group and its partitions are handed to another member. That rebalance is a safety net for a stuck worker. It turns into a storm when a healthy worker simply cannot finish a full batch in time. Its offsets are never committed, so the next owner receives the same records, takes just as long and is evicted too. Everyone is busy and nothing is committed. It often stays hidden until a backlog forms, because only then does every poll return a full batch. Fetch fewer records per poll with max.poll.records, or allow more time, so a full batch always fits inside the deadline.
In Spring Boot
Poll settings for a Spring Kafka consumer
# records handed to the listener per poll (Kafka default: 500)
spring.kafka.consumer.max-poll-records=50
# longest allowed gap between two polls (Kafka default: 300000 ms)
spring.kafka.consumer.properties[max.poll.interval.ms]=300000A consumer must finish a whole batch and poll again inside max.poll.interval.ms, or it is removed from the group. Fewer records per poll means less work between polls: at 50 records, each may take up to 6 seconds before the five-minute limit is reached.
Gotcha: Size it from your slowest record, not the average: records per poll times worst-case time per record must stay under the interval. Raising the interval hides the problem and also delays the moment a consumer that is truly stuck is noticed.
Names checked against the official docs on 15 Nov 2026:
How this comes up in interviews
"After a traffic burst, a consumer group keeps rebalancing, every consumer is busy, and no offsets are committed. What is happening?"
Then they ask
- Heartbeats are healthy. Why are the consumers still being removed from the group?
- Why did this stay hidden until a backlog formed?
- Would adding or restarting consumers help? What would you change instead?
A strong answer covers
- A consumer shows health two ways: heartbeats from a background thread, and calling poll() for the next batch.
- If the gap between polls exceeds max.poll.interval.ms, the consumer leaves the group and its partitions move.
- Its offsets were never committed, so the next owner gets the same records, takes as long and is evicted too.
- It appears with a backlog because only then does every poll return a full batch.
- Lower max.poll.records or allow more time, so that a full batch always fits inside the deadline.
Points to cover, not a script. Say them in your own words and tie them to a system you have worked on.
On one page: the track cheat sheet.
Sources: Apache Kafka documentation: consumer configs ↗ · KIP-62: Allow consumer to send heartbeats from a background thread ↗ · Report a problem
Diagrams are our own simulations: the timings, rates and counts in them are illustrative, not measurements. Captions are original wording.