Class CustomKafkaConsumer
java.lang.Object
org.chenile.pubsub.kafka.configuration.CustomKafkaConsumer
- All Implemented Interfaces:
EventListener, ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>, Ordered
@Component
public class CustomKafkaConsumer
extends Object
implements ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>, Ordered
Dynamically registers Kafka listener for all topics defined in Chenile configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classProcessor class for handling Kafka messages. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChenileConfigurationprivate EventProcessorprivate static final org.slf4j.Loggerprivate org.springframework.kafka.config.KafkaListenerEndpointRegistryFields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidonApplicationEvent(org.springframework.boot.context.event.ApplicationReadyEvent event) Registers a dynamic Kafka listener after application startup.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ApplicationListener
supportsAsyncExecution
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
registry
-
factory
@Autowired private org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory<String,String> factory -
chenileConfig
-
eventProcessor
-
-
Constructor Details
-
CustomKafkaConsumer
public CustomKafkaConsumer()
-
-
Method Details
-
onApplicationEvent
public void onApplicationEvent(org.springframework.boot.context.event.ApplicationReadyEvent event) Registers a dynamic Kafka listener after application startup.- Specified by:
onApplicationEventin interfaceApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>
-
getOrder
-