K - the key type.V - the value type.public abstract class AbstractAdaptableMessageListener<K,V> extends java.lang.Object implements MessageListener<K,V>, AcknowledgingMessageListener<K,V>
MessageListener adapter providing the necessary infrastructure
to extract the payload of a Message.MessageListener,
AcknowledgingMessageListener| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
AbstractAdaptableMessageListener() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
extractMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record)
Extract the message body from the given Kafka message.
|
protected void |
handleListenerException(java.lang.Throwable ex)
Handle the given exception that arose during listener execution.
|
void |
onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record)
Kafka
MessageListener entry point. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonMessagepublic void onMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> record)
MessageListener entry point.
Delegate the message to the target listener method, with appropriate conversion of the message argument.
onMessage in interface MessageListener<K,V>record - the incoming Kafka ConsumerRecord.handleListenerException(java.lang.Throwable),
AcknowledgingMessageListener.onMessage(ConsumerRecord, org.springframework.kafka.support.Acknowledgment)protected void handleListenerException(java.lang.Throwable ex)
onMessage(ConsumerRecord)
or AcknowledgingMessageListener.onMessage(ConsumerRecord, org.springframework.kafka.support.Acknowledgment)
The default implementation logs the exception at error level.ex - the exception to handle