Kafka consumer groups allow multiple consumers to process messages in parallel. When consumers join, leave, or fail, Kafka redistributes partitions to keep the workload balanced.
Traditionally, Kafka handled these changes using the classic consumer group protocol, where consumers coordinate through JoinGroup and SyncGroup requests.
This approach works well, but it has an important limitation: rebalancing requires group-wide synchronization.
As consumer groups grow, coordinating hundreds or thousands of consumers can become expensive. Even a small membership change may require every consumer to participate in the rebalance.
To address this, Kafka introduced a new consumer rebalance protocol through KIP-848, which became generally available in Apache Kafka 4.0.
The new protocol moves partition assignment to the broker and allows consumers to update their assignments independently, without waiting for the entire group to synchronize.
Let's understand how it works.