public abstract class AbstractDecodingMessageListener<K,P> extends java.lang.Object implements MessageListener
MessageListener 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.| Constructor and Description |
|---|
AbstractDecodingMessageListener(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)
Process the decoded message
|
void |
onMessage(KafkaMessage message)
Executes when a Kafka message is received
|
public final void onMessage(KafkaMessage message)
MessageListeneronMessage in interface MessageListenermessage - the Kafka message to be processedpublic abstract void doOnMessage(K key, P payload, KafkaMessageMetadata metadata)
key - the message keypayload - the message bodymetadata - the KafkaMessageMetadata