Class RawMessageImpl

  • All Implemented Interfaces:
    RawMessage

    public class RawMessageImpl
    extends java.lang.Object
    implements RawMessage
    • Method Detail

      • release

        public void release()
        Description copied from interface: RawMessage
        Release all the resources associated with this raw message.
        Specified by:
        release in interface RawMessage
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Description copied from interface: RawMessage
        Return the properties attached to the message.

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

        Specified by:
        getProperties in interface RawMessage
        Returns:
        an unmodifiable view of the properties map
      • getData

        public io.netty.buffer.ByteBuf getData()
        Description copied from interface: RawMessage
        Get the content of the message.
        Specified by:
        getData in interface RawMessage
        Returns:
        the byte array with the message payload
      • getMessageId

        public RawMessageId getMessageId()
        Description copied from interface: RawMessage
        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.

        Specified by:
        getMessageId in interface RawMessage
        Returns:
        the message id null if this message was not received by this client instance
      • getPublishTime

        public long getPublishTime()
        Description copied from interface: RawMessage
        Get the publish time of this message. The publish time is the timestamp that a client publish the message.
        Specified by:
        getPublishTime in interface RawMessage
        Returns:
        publish time of this message.
        See Also:
        RawMessage.getEventTime()
      • getEventTime

        public long getEventTime()
        Description copied from interface: RawMessage
        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.

        Specified by:
        getEventTime in interface RawMessage
      • getSequenceId

        public long getSequenceId()
        Description copied from interface: RawMessage
        Get the sequence id associated with this message. It is typically set by the applications via MessageBuilder#setSequenceId(long).
        Specified by:
        getSequenceId in interface RawMessage
        Returns:
        sequence id associated with this message.
        See Also:
        MessageBuilder#setEventTime(long)
      • getProducerName

        public java.lang.String getProducerName()
        Description copied from interface: RawMessage
        Get the producer name who produced this message.
        Specified by:
        getProducerName in interface RawMessage
        Returns:
        producer name who produced this message, null if producer name is not set.
      • getKey

        public java.util.Optional<java.lang.String> getKey()
        Description copied from interface: RawMessage
        Get the key of the message.
        Specified by:
        getKey in interface RawMessage
        Returns:
        the key of the message
      • getSchemaVersion

        public byte[] getSchemaVersion()
        Description copied from interface: RawMessage
        Get the schema verison of the message.
        Specified by:
        getSchemaVersion in interface RawMessage
        Returns:
        the schema version of the message
      • getKeyBytes

        public java.util.Optional<io.netty.buffer.ByteBuf> getKeyBytes()
        Description copied from interface: RawMessage
        Get byteBuf of the key.
        Specified by:
        getKeyBytes in interface RawMessage
        Returns:
        the byte array with the key payload
      • hasBase64EncodedKey

        public boolean hasBase64EncodedKey()
        Description copied from interface: RawMessage
        Check whether the key has been base64 encoded.
        Specified by:
        hasBase64EncodedKey in interface RawMessage
        Returns:
        true if the key is base64 encoded, false otherwise
      • getBatchSize

        public int getBatchSize()