SpringSpring Kafka Configuration
How do you configure multiple @KafkaListener annotations for the same topic with different group IDs?
Reference answer
Use the groupId attribute: @KafkaListener(topics='orders', groupId='order-processor') and @KafkaListener(topics='orders', groupId='analytics') in different beans or the same bean. Each creates an independent consumer group with its own offset tracking. Alternatively, use different @KafkaListener container factories with different default groupIds. In test scenarios, give each listener a unique groupId to prevent state leakage between tests.
Expected key concepts: groupId attribute, @KafkaListener, independent consumer group, offset tracking, container factories, test isolation, analytics, order-processor