Sobes.tech
Middle+

What happens if there are 5 partitions in a topic and 10 consumers in one consumer group?

sobes.tech AI

Answer from AI

If a Kafka topic has 5 partitions and a consumer group has 10 consumers, the distribution will be as follows:

  • Up to 5 consumers can read data simultaneously, as each partition can only be assigned to one consumer in the group.
  • The remaining 5 consumers will be idle, as there are fewer partitions than consumers.

Thus, the number of active consumers is limited by the number of partitions. To efficiently utilize all 10 consumers, you need to increase the number of partitions in the topic to 10 or more.

This is important to consider when scaling consumers to avoid creating excess resources that will not be used.

What happens if there are 5 partitions in a topic and… - sobes.tech