Consumer Groups

Learn about the Kafka messaging model and why we need consumer groups.

We learned that only one consumer per consumer group can consume from a specific partition. In this lesson, we’ll learn what a consumer group is and why they are needed.

What are consumer groups?

The members of a consumer group are consumers who share the workload of processing messages from a specific topic (or set of topics). Practically, we define consumers to be in the same consumer group by giving them the same group ID.

Each consumer in the group is assigned a different set of partitions—a partition can only be assigned to one consumer per consumer group. Because a specific message can exist only in one partition, it is impossible for multiple consumers in the same group to process the same message.

Get hands-on with 1200+ tech skills courses.