public interface MessagePayloadContext
| Modifier and Type | Method and Description |
|---|---|
<T> Message<T> |
asSingleMessage(MessagePayload payload,
Schema<T> schema)
Convert the given payload to a single message if the entry is not a batch.
|
<T> Message<T> |
getMessageAt(int index,
int numMessages,
MessagePayload payload,
boolean containMetadata,
Schema<T> schema)
Get the internal single message with a specific index from a payload if the payload is a batch.
|
int |
getNumMessages()
Get the number of messages when the payload is produced by Pulsar producer.
|
String |
getProperty(String key)
Get a value associated with the given key.
|
boolean |
isBatch()
Check whether the payload is a batch when the payload is produced by Pulsar producer.
|
String getProperty(String key)
key - int getNumMessages()
boolean isBatch()
<T> Message<T> getMessageAt(int index, int numMessages, MessagePayload payload, boolean containMetadata, Schema<T> schema)
T - index - the batch indexnumMessages - the number of messages in the batchpayload - the message payloadcontainMetadata - whether the payload contains the single message metadataschema - the schema of the batch<T> Message<T> asSingleMessage(MessagePayload payload, Schema<T> schema)
T - payload - the message payloadschema - the schema of the messageCopyright © 2017–2021 Apache Software Foundation. All rights reserved.