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.
Top level interface for listeners.
- Since:
- 1.1
- Author:
- Gary Russell
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked with data from kafka.default void
Invoked with data from kafka and provides access to theConsumer
.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 theConsumer
.
-
Method Details
-
onMessage
Invoked with data from kafka.- Parameters:
data
- the data to be processed.
-
onMessage
Invoked with data from kafka. The default implementation throwsUnsupportedOperationException
.- Parameters:
data
- the data to be processed.acknowledgment
- the acknowledgment.
-
onMessage
Invoked with data from kafka and provides access to theConsumer
. The default implementation throwsUnsupportedOperationException
.- 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 theConsumer
. The default implementation throwsUnsupportedOperationException
.- Parameters:
data
- the data to be processed.acknowledgment
- the acknowledgment.consumer
- the consumer.- Since:
- 2.0
-