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 listeners for configured topic-to-event bindings.
  • Field Details

  • 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:
      onApplicationEvent in interface ApplicationListener<org.springframework.boot.context.event.ApplicationReadyEvent>
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface Ordered
    • topicToEventBindings

      private Map<String,String> topicToEventBindings()