Senior
What does Kafka guarantee when using a consumer group with three partitions and three consumers?
sobes.tech AI
Answer from AI
When using a consumer group with three partitions and three consumers, Kafka guarantees:
- Each partition will be assigned to exactly one consumer in the group. Thus, all three consumers will read data in parallel, but without overlaps across partitions.
- Message order within a single partition is preserved. The consumer reading a specific partition receives messages in the same order they were written.
- Load balancing is ensured. If there are fewer consumers than partitions, some consumers will read multiple partitions; if there are more, the extra consumers will be idle.
Therefore, with an equal number of partitions and consumers, each consumer processes a unique partition, ensuring parallel processing without duplication and guaranteeing order within partitions.