Interface KafkaTools.ConsumerLoopCallback

Enclosing class:
KafkaTools

public static interface KafkaTools.ConsumerLoopCallback
A callback which is invoked from the consumer loop, enabling clients to inject logic to be invoked by the Kafka consumer thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterPoll(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer, boolean more)
    Called after the consumer is polled for records and they have been published to the downstream KafkaRecordConsumer.
    void
    beforePoll(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer)
    Called before the consumer is polled for records.
  • Method Details

    • beforePoll

      void beforePoll(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer)
      Called before the consumer is polled for records.
      Parameters:
      consumer - the KafkaConsumer that will be polled for records
    • afterPoll

      void afterPoll(org.apache.kafka.clients.consumer.KafkaConsumer<?,?> consumer, boolean more)
      Called after the consumer is polled for records and they have been published to the downstream KafkaRecordConsumer.
      Parameters:
      consumer - the KafkaConsumer that has been polled for records
      more - true if more records should be read, false if the consumer should be shut down due to error