Package api.mpba.rastvdmy.config
Class KafkaConsumerConfig
java.lang.Object
api.mpba.rastvdmy.config.KafkaConsumerConfig
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis method provides the configuration for Kafka consumers.This method provides a ConsumerFactory bean.org.springframework.kafka.config.KafkaListenerContainerFactory
<org.springframework.kafka.listener.ConcurrentMessageListenerContainer<String, String>> This method provides a KafkaListenerContainerFactory bean.
-
Constructor Details
-
KafkaConsumerConfig
public KafkaConsumerConfig()
-
-
Method Details
-
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
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.
-