org.springframework.integration.kafka.listener
Class AbstractDecodingAcknowledgingMessageListener<K,P>
java.lang.Object
org.springframework.integration.kafka.listener.AbstractDecodingAcknowledgingMessageListener<K,P>
- All Implemented Interfaces:
- AcknowledgingMessageListener
public abstract class AbstractDecodingAcknowledgingMessageListener<K,P>
- extends java.lang.Object
- implements AcknowledgingMessageListener
Base AcknowledgingMessageListener implementation that decodes the key and the
payload using the supplied Decoders.
Users of this class must extend it and implement doOnMessage and must supply
Decoder implementations for both the key and the payload.
- Since:
- 1.0.1
- Author:
- Marius Bogoevici
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDecodingAcknowledgingMessageListener
public AbstractDecodingAcknowledgingMessageListener(kafka.serializer.Decoder<K> keyDecoder,
kafka.serializer.Decoder<P> payloadDecoder)
onMessage
public final void onMessage(KafkaMessage message,
Acknowledgment acknowledgment)
- Description copied from interface:
AcknowledgingMessageListener
- Executes when a Kafka message is received
- Specified by:
onMessage in interface AcknowledgingMessageListener
- Parameters:
message - the Kafka message to be processedacknowledgment - a handle for acknowledging the message processing
doOnMessage
public abstract void doOnMessage(K key,
P payload,
KafkaMessageMetadata metadata,
Acknowledgment acknowledgment)
- Process the decoded message
- Parameters:
key - the message keypayload - the message bodymetadata - the KafkaMessageMetadataacknowledgment - the acknowledgment handle