Consumer group: Kafka assigns each partition to one consumer in the group, spreading load. Multiple groups can consume the same topic independently, each maintaining its own offset — the pub/sub and queue models in one.
2 / 5
What is a rebalance in a consumer group?
Rebalance: triggered when a consumer joins, leaves, or crashes, or when partitions are added. During rebalance, consumption pauses while the group coordinator reassigns partitions, which can cause latency spikes.
3 / 5
What is the role of the group coordinator?
Group coordinator: one broker hosts the internal __consumer_offsets partition for the group and acts as coordinator, processing JoinGroup and SyncGroup requests during rebalances and heartbeats.
4 / 5
What does committing an offset mean for a consumer?
Offset commit: Kafka does not delete messages after delivery. Consumers track their position by committing offsets to __consumer_offsets. On restart, the consumer resumes from the last committed offset.
5 / 5
What is the trade-off of auto-commit vs manual offset commit?
Auto-commit risk: if the consumer crashes after auto-committing but before finishing processing, those messages are skipped. Manual commit after successful processing gives exactly-once or at-least-once guarantees.