Messagingcompeting consumersconsumer groups

Consumer group

Definition

A consumer group is a named set of consumers that together read a stream, with the broker assigning partitions or messages so that each is handled by exactly one member.

In practice

Groups give both scale-out and fan-out: add members to process faster, or add another group to have a second application read the same stream independently. In Kafka each partition goes to one member at a time, so partitions cap useful group size.

Membership changes trigger rebalancing, which pauses consumption briefly and can cause duplicates if offsets were not committed. Consumer lag per partition shows whether the group keeps up.

Example

A billing group with 6 consumers reads a 12-partition topic, two partitions each, while an analytics group reads the same events at its own pace.