public class RawMessageImpl extends Object implements RawMessage
| Modifier and Type | Method and Description |
|---|---|
static RawMessage |
get(ReferenceCountedObject<PulsarApi.MessageMetadata> msgMetadata,
PulsarApi.SingleMessageMetadata.Builder singleMessageMetadata,
io.netty.buffer.ByteBuf payload,
long ledgerId,
long entryId,
long batchIndex) |
int |
getBatchSize() |
io.netty.buffer.ByteBuf |
getData()
Get the content of the message.
|
long |
getEventTime()
Get the event time associated with this message.
|
Optional<String> |
getKey()
Get the key of the message.
|
Optional<io.netty.buffer.ByteBuf> |
getKeyBytes()
Get byteBuf of the key.
|
RawMessageId |
getMessageId()
Get the unique message ID associated with this message.
|
String |
getProducerName()
Get the producer name who produced this message.
|
Map<String,String> |
getProperties()
Return the properties attached to the message.
|
long |
getPublishTime()
Get the publish time of this message.
|
byte[] |
getSchemaVersion()
Get the schema verison of the message.
|
long |
getSequenceId()
Get the sequence id associated with this message.
|
boolean |
hasBase64EncodedKey()
Check whether the key has been base64 encoded.
|
void |
release()
Release all the resources associated with this raw message.
|
public void release()
RawMessagerelease in interface RawMessagepublic static RawMessage get(ReferenceCountedObject<PulsarApi.MessageMetadata> msgMetadata, PulsarApi.SingleMessageMetadata.Builder singleMessageMetadata, io.netty.buffer.ByteBuf payload, long ledgerId, long entryId, long batchIndex)
public Map<String,String> getProperties()
RawMessageProperties are application defined key/value pairs that will be attached to the message.
getProperties in interface RawMessagepublic io.netty.buffer.ByteBuf getData()
RawMessagegetData in interface RawMessagepublic RawMessageId getMessageId()
RawMessageThe message id can be used to univocally refer to a message without having the keep the entire payload in memory.
Only messages received from the consumer will have a message id assigned.
getMessageId in interface RawMessagepublic long getPublishTime()
RawMessagegetPublishTime in interface RawMessageRawMessage.getEventTime()public long getEventTime()
RawMessageMessageBuilder#setEventTime(long).
If there isn't any event time associated with this event, it will return 0.
getEventTime in interface RawMessagepublic long getSequenceId()
RawMessageMessageBuilder#setSequenceId(long).getSequenceId in interface RawMessageMessageBuilder#setEventTime(long)public String getProducerName()
RawMessagegetProducerName in interface RawMessagepublic Optional<String> getKey()
RawMessagegetKey in interface RawMessagepublic byte[] getSchemaVersion()
RawMessagegetSchemaVersion in interface RawMessagepublic Optional<io.netty.buffer.ByteBuf> getKeyBytes()
RawMessagegetKeyBytes in interface RawMessagepublic boolean hasBase64EncodedKey()
RawMessagehasBase64EncodedKey in interface RawMessagepublic int getBatchSize()
Copyright © 2017–2021 Apache Software Foundation. All rights reserved.