public class KafkaMetadataUtil extends Object
KafkaMessageMetadata in a Message.| Constructor and Description |
|---|
KafkaMetadataUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Optional<IncomingKafkaRecordMetadata> |
readIncomingKafkaMetadata(Message<?> msg)
Read
IncomingKafkaRecordMetadata from a Message. |
static <T,K> Message<T> |
writeOutgoingKafkaMetadata(Message<T> msg,
OutgoingKafkaRecordMetadata<K> outgoingKafkaRecordMetadata)
Write
OutgoingKafkaRecordMetadata to a Message. |
public static Optional<IncomingKafkaRecordMetadata> readIncomingKafkaMetadata(Message<?> msg)
IncomingKafkaRecordMetadata from a Message.msg - the message. Must not be nullIncomingKafkaRecordMetadata. May return null, for example if the message is
not received from a channel backed by KafkaNullPointerException - if msg is nullpublic static <T,K> Message<T> writeOutgoingKafkaMetadata(Message<T> msg, OutgoingKafkaRecordMetadata<K> outgoingKafkaRecordMetadata)
OutgoingKafkaRecordMetadata to a Message. Note that Message is immutable,
so the passed in parameter will not have the OutgoingKafkaRecordMetadata added. This
method returns a new instance of Message with the OutgoingKafkaRecordMetadata added.msg - the message. Must not be nulloutgoingKafkaRecordMetadata - the OutgoingKafkaRecordMetadata to write. Must not be nullOutgoingKafkaRecordMetadata addedNullPointerException - if msg or outgoingKafkaRecordMetadata are nullCopyright © 2018–2021 SmallRye. All rights reserved.