Consumer groups are how you fan out to independent services from one topic.
@KafkaListener(topics = "orders", groupId = "email-service")
void sendEmail(Order o) { ... }
@KafkaListener(topics = "orders", groupId = "analytics-service")
void record(Order o) { ... }
One order produces one record.
Both services receive it, because each group tracks its own offsets.
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