Interface RawMessage

  • All Known Implementing Classes:
    RawMessageImpl

    public interface RawMessage
    View of a message that exposes the internal direct-memory buffer for more efficient processing.

    The message needs to be released when the processing is done.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getChunkId()
      Get chunkId of chunked message.
      io.netty.buffer.ByteBuf getData()
      Get the content of the message.
      long getEventTime()
      Get the event time associated with this message.
      java.util.Optional<java.lang.String> getKey()
      Get the key of the message.
      java.util.Optional<io.netty.buffer.ByteBuf> getKeyBytes()
      Get byteBuf of the key.
      RawMessageId getMessageId()
      Get the unique message ID associated with this message.
      int getNumChunksFromMsg()
      Get chunk num of chunked message.
      java.lang.String getProducerName()
      Get the producer name who produced this message.
      java.util.Map<java.lang.String,​java.lang.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.
      int getTotalChunkMsgSize()
      Get chunk message total size in bytes.
      java.lang.String getUUID()
      Get uuid of chunked message.
      boolean hasBase64EncodedKey()
      Check whether the key has been base64 encoded.
      void release()
      Release all the resources associated with this raw message.
    • Method Detail

      • release

        void release()
        Release all the resources associated with this raw message.
      • getProperties

        java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Return the properties attached to the message.

        Properties are application defined key/value pairs that will be attached to the message.

        Returns:
        an unmodifiable view of the properties map
      • getData

        io.netty.buffer.ByteBuf getData()
        Get the content of the message.
        Returns:
        the byte array with the message payload
      • getMessageId

        RawMessageId getMessageId()
        Get the unique message ID associated with this message.

        The 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.

        Returns:
        the message id null if this message was not received by this client instance
      • getPublishTime

        long getPublishTime()
        Get the publish time of this message. The publish time is the timestamp that a client publish the message.
        Returns:
        publish time of this message.
        See Also:
        getEventTime()
      • getEventTime

        long getEventTime()
        Get the event time associated with this message. It is typically set by the applications via MessageBuilder#setEventTime(long).

        If there isn't any event time associated with this event, it will return 0.

      • getSequenceId

        long getSequenceId()
        Get the sequence id associated with this message. It is typically set by the applications via MessageBuilder#setSequenceId(long).
        Returns:
        sequence id associated with this message.
        See Also:
        MessageBuilder#setEventTime(long)
      • getProducerName

        java.lang.String getProducerName()
        Get the producer name who produced this message.
        Returns:
        producer name who produced this message, null if producer name is not set.
      • getKey

        java.util.Optional<java.lang.String> getKey()
        Get the key of the message.
        Returns:
        the key of the message
      • getSchemaVersion

        byte[] getSchemaVersion()
        Get the schema verison of the message.
        Returns:
        the schema version of the message
      • getKeyBytes

        java.util.Optional<io.netty.buffer.ByteBuf> getKeyBytes()
        Get byteBuf of the key.
        Returns:
        the byte array with the key payload
      • hasBase64EncodedKey

        boolean hasBase64EncodedKey()
        Check whether the key has been base64 encoded.
        Returns:
        true if the key is base64 encoded, false otherwise
      • getUUID

        java.lang.String getUUID()
        Get uuid of chunked message.
        Returns:
        uuid
      • getChunkId

        int getChunkId()
        Get chunkId of chunked message.
        Returns:
        chunkId
      • getNumChunksFromMsg

        int getNumChunksFromMsg()
        Get chunk num of chunked message.
        Returns:
        chunk num
      • getTotalChunkMsgSize

        int getTotalChunkMsgSize()
        Get chunk message total size in bytes.
        Returns:
        chunked message total size in bytes