Class KafkaConsumerConfig

java.lang.Object
api.mpba.rastvdmy.config.KafkaConsumerConfig

@Configuration public class KafkaConsumerConfig extends Object
This class is responsible for the configuration of Kafka consumers. It provides the necessary beans for creating Kafka consumers. The configuration properties are fetched from the application's properties file.
  • Constructor Details

    • KafkaConsumerConfig

      public KafkaConsumerConfig()
  • Method Details

    • consumerConfig

      public Map<String,Object> consumerConfig()
      This method provides the configuration for Kafka consumers. It sets the bootstrap servers, key deserializer and value deserializer.
      Returns:
      A map containing the configuration properties.
    • consumerFactory

      @Bean public org.springframework.kafka.core.ConsumerFactory<String,String> consumerFactory()
      This method provides a ConsumerFactory bean. The ConsumerFactory is responsible for creating Kafka consumers.
      Returns:
      A new instance of DefaultKafkaConsumerFactory.
    • factory

      @Bean public org.springframework.kafka.config.KafkaListenerContainerFactory<org.springframework.kafka.listener.ConcurrentMessageListenerContainer<String,String>> factory(org.springframework.kafka.core.ConsumerFactory<String,String> consumerFactory)
      This method provides a KafkaListenerContainerFactory bean. The KafkaListenerContainerFactory is responsible for creating Kafka listener containers.
      Parameters:
      consumerFactory - The consumer factory.
      Returns:
      A new instance of ConcurrentKafkaListenerContainerFactory.