Kafka: A consumer group divides partitions among its members

One partition goes to exactly one consumer in the group - so more consumers than partitions leaves some idle.

Code
// topic with 6 partitions
// group "orders-service" with 3 consumers -> 2 partitions each
// group "orders-service" with 8 consumers -> 6 work, 2 idle
Output
Partition count is the ceiling on parallelism for a group.
Scaling past it needs more partitions, not more pods.
Advertisement

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-11