Package org.apache.pulsar.client.api
Interface RawMessage
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
RawMessageImpl
A representation of a message in a topic in its raw form (i.e. as it is stored in a managed ledger).
RawMessages hold a refcount to the contains ByteBuf, so they must be closed for the ByteBuf to be freed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()io.netty.buffer.ByteBufGet a ByteBuf which contains the headers and payload of the message.org.apache.pulsar.client.api.MessageIdGet the message ID of this message.org.apache.pulsar.common.api.proto.MessageIdDataGet the protobuf representation of the message ID of this message.io.netty.buffer.ByteBufSerialize a raw message to a ByteBuf.
-
Method Details
-
getMessageId
org.apache.pulsar.client.api.MessageId getMessageId()Get the message ID of this message. -
getMessageIdData
org.apache.pulsar.common.api.proto.MessageIdData getMessageIdData()Get the protobuf representation of the message ID of this message. -
getHeadersAndPayload
io.netty.buffer.ByteBuf getHeadersAndPayload()Get a ByteBuf which contains the headers and payload of the message. The payload may be compressed and encrypted, but whether this is the case can be verified by decoding the headers which are not. -
serialize
io.netty.buffer.ByteBuf serialize()Serialize a raw message to a ByteBuf. The caller is responsible for releasing the returned ByteBuf. -
close
void close()- Specified by:
closein interfaceAutoCloseable
-