Kafka Tutorial: Generate Multiple Consumer Groups Dynamically With Spring-Kafka

Hey all, today I will show one way to generate multiple consumer groups dynamically with Spring-Kafka. Before this approach, let's do it with annotations. We just create a configuration class which consist of  a  spring @Bean that generates our KafkaListenerContainerFactory.

You may also like: Spring for Apache Kafka Part 1: Error Handling, Message Conversion, and Transaction Support.

Example consumer config file: