org.springframework.integration.kafka.listener
Class AbstractDecodingMessageListener<K,P>
java.lang.Object
org.springframework.integration.kafka.listener.AbstractDecodingMessageListener<K,P>
- All Implemented Interfaces:
- MessageListener
public abstract class AbstractDecodingMessageListener<K,P>
- extends java.lang.Object
- implements MessageListener
Base MessageListener
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.
- Author:
- Marius Bogoevici
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDecodingMessageListener
public AbstractDecodingMessageListener(kafka.serializer.Decoder<K> keyDecoder,
kafka.serializer.Decoder<P> payloadDecoder)
onMessage
public final void onMessage(KafkaMessage message)
- Description copied from interface:
MessageListener
- Executes when a Kafka message is received
- Specified by:
onMessage
in interface MessageListener
- Parameters:
message
- the Kafka message to be processed
doOnMessage
public abstract void doOnMessage(K key,
P payload,
KafkaMessageMetadata metadata)
- Process the decoded message
- Parameters:
key
- the message keypayload
- the message bodymetadata
- the KafkaMessageMetadata