Interface GenericMessageListener<T>

Type Parameters:
T - the type received by the listener.
All Known Subinterfaces:
AcknowledgingConsumerAwareMessageListener<K,V>, AcknowledgingMessageListener<K,V>, BatchAcknowledgingConsumerAwareMessageListener<K,V>, BatchAcknowledgingMessageListener<K,V>, BatchConsumerAwareMessageListener<K,V>, BatchMessageListener<K,V>, ConsumerAwareMessageListener<K,V>, MessageListener<K,V>
All Known Implementing Classes:
AggregatingReplyingKafkaTemplate, BatchMessagingMessageListenerAdapter, ConvertingMessageListener, FilteringBatchMessageListenerAdapter, FilteringMessageListenerAdapter, KafkaBackoffAwareMessageListenerAdapter, RecordMessagingMessageListenerAdapter, ReplyingKafkaTemplate
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GenericMessageListener<T>
Top level interface for listeners.
Since:
1.1
Author:
Gary Russell
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onMessage(T data)
    Invoked with data from kafka.
    default void
    onMessage(T data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
    Invoked with data from kafka and provides access to the Consumer.
    default void
    onMessage(T data, Acknowledgment acknowledgment)
    Invoked with data from kafka.
    default void
    onMessage(T data, Acknowledgment acknowledgment, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
    Invoked with data from kafka and provides access to the Consumer.
  • Method Details

    • onMessage

      void onMessage(T data)
      Invoked with data from kafka.
      Parameters:
      data - the data to be processed.
    • onMessage

      default void onMessage(T data, @Nullable Acknowledgment acknowledgment)
      Invoked with data from kafka. The default implementation throws UnsupportedOperationException.
      Parameters:
      data - the data to be processed.
      acknowledgment - the acknowledgment.
    • onMessage

      default void onMessage(T data, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Invoked with data from kafka and provides access to the Consumer. The default implementation throws UnsupportedOperationException.
      Parameters:
      data - the data to be processed.
      consumer - the consumer.
      Since:
      2.0
    • onMessage

      default void onMessage(T data, @Nullable Acknowledgment acknowledgment, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Invoked with data from kafka and provides access to the Consumer. The default implementation throws UnsupportedOperationException.
      Parameters:
      data - the data to be processed.
      acknowledgment - the acknowledgment.
      consumer - the consumer.
      Since:
      2.0