Interface RawMessage

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
RawMessageImpl

public interface RawMessage extends AutoCloseable
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 Type
    Method
    Description
    void
     
    io.netty.buffer.ByteBuf
    Get a ByteBuf which contains the headers and payload of the message.
    org.apache.pulsar.client.api.MessageId
    Get the message ID of this message.
    org.apache.pulsar.common.api.proto.MessageIdData
    Get the protobuf representation of the message ID of this message.
    io.netty.buffer.ByteBuf
    Serialize 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:
      close in interface AutoCloseable