public abstract class AbstractDecodingAcknowledgingMessageListener<K,P> extends java.lang.Object implements AcknowledgingMessageListener
AcknowledgingMessageListener
implementation that decodes the key and the
payload using the supplied Decoder
s.
Users of this class must extend it and implement doOnMessage
and must supply
Decoder
implementations for both the key and the payload.Constructor and Description |
---|
AbstractDecodingAcknowledgingMessageListener(kafka.serializer.Decoder<K> keyDecoder,
kafka.serializer.Decoder<P> payloadDecoder) |
Modifier and Type | Method and Description |
---|---|
abstract void |
doOnMessage(K key,
P payload,
KafkaMessageMetadata metadata,
Acknowledgment acknowledgment)
Process the decoded message
|
void |
onMessage(KafkaMessage message,
Acknowledgment acknowledgment)
Executes when a Kafka message is received
|
public final void onMessage(KafkaMessage message, Acknowledgment acknowledgment)
AcknowledgingMessageListener
onMessage
in interface AcknowledgingMessageListener
message
- the Kafka message to be processedacknowledgment
- a handle for acknowledging the message processingpublic abstract void doOnMessage(K key, P payload, KafkaMessageMetadata metadata, Acknowledgment acknowledgment)
key
- the message keypayload
- the message bodymetadata
- the KafkaMessageMetadataacknowledgment
- the acknowledgment handle