concurrency creates that many consumer threads in the group - capped by the partition count.
@KafkaListener(topics = "orders", groupId = "orders-service", concurrency = "3")
void onOrder(ConsumerRecord<String, String> record) { ... }
3 partitions -> 3 threads, one each
6 partitions -> 3 threads, two each
2 partitions -> 3 threads, one permanently idle
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