When consumers in a Kafka consumer group divide partitions, one consumer creates the distribution plan. The first consumer to join becomes the group leader. During a rebalance, it determines which member gets each partition and sends the plan to the group coordinator, a broker. The coordinator relays the assignments; members can then resume consuming from their assigned partitions. section 9.4.1 section 9.4.2
Figure 9.4 The Kafka Rebalance Protocol allows a group to distribute certain resources among its members, for example, consumer partitions. In this process, a broker acts as the group coordinator, and one of the consumers serves as the group leader.
The rebalance diagram distinguishes the consumer acting as group leader from the broker acting as group coordinator. section 9.4.1
Assigning two topics
With the default Range Assignor, two topics with two partitions each and three consumers place partition 0 of both topics on one consumer and partition 1 of both on another. The third consumer receives no partitions. This arrangement can help when corresponding partitions of two topics need to be processed together, but it does not use every available consumer. section 9.4.2
The leader applies the group's partition assignment strategy; it does not replace the coordinator. Configure the strategy with partition.assignment.strategy, and keep it the same across all consumers in the group. Mixed strategies can make assignments unpredictable and cause processing inconsistencies or performance problems. section 9.4.2

