A consumer group is a set of consumers that cooperatively split the partitions of one or more topics among themselves, so the group as a whole can process a topic's data in parallel while each partition is still consumed by exactly one member at a time.
An analytics pipeline processing a high-volume "events" topic with 20 partitions might start with 4 consumer instances and later scale up to 20 as volume grows, each addition automatically absorbing a share of the remaining partitions during rebalance.
// One application instance running 4 consumer threads in the same group.
// Starting more instances adds more consumers; Kafka rebalances partitions.
@KafkaListener(topics = "events", groupId = "analytics", concurrency = "4")
public void consume(String event) {
// process event
}
# Check how partitions are assigned and how far behind each consumer is
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group analytics
GROUP TOPIC PARTITION CURRENT-OFFSET LOG-END-OFFSET LAG CONSUMER-ID
analytics events 0 1520 1530 10 consumer-1-a1b2
analytics events 1 1498 1498 0 consumer-2-c3d4A concise interview answer is
Consumer groups improve scalability by letting Kafka automatically split a topic's partitions across multiple consumer instances, so adding more consumers to the group increases processing parallelism up to the number of partitions, while Kafka handles rebalancing the work whenever group membership changes.
Last updated: 1 November 2026
Previous question: What are some of the strategies consumers use to read data from Kafka?
Next question: How does Kafka achieve fault tolerance?