Interface Message


public interface Message
AMQP 1.0 message.
See Also:
  • Method Details

    • messageId

      Object messageId()
      Get message ID.
      Returns:
      the message ID
    • messageIdAsString

      String messageIdAsString()
      Get message ID as a string.
      Returns:
      the message ID as a string
    • messageIdAsLong

      long messageIdAsLong()
      Get message ID as a long.
      Returns:
      the message ID as a long
    • messageIdAsBinary

      byte[] messageIdAsBinary()
      Get message ID as an array of bytes.
      Returns:
      the message ID as an array of bytes
    • messageIdAsUuid

      UUID messageIdAsUuid()
      Get message ID as a UUID.
      Returns:
      the message ID as a UUID
    • correlationId

      Object correlationId()
      Get message correlation ID.
      Returns:
      the message correlation ID
    • correlationIdAsString

      String correlationIdAsString()
      Get message correlation ID as a string.
      Returns:
      the message correlation ID as a string
    • correlationIdAsLong

      long correlationIdAsLong()
      Get message correlation ID as a long.
      Returns:
      the message correlation ID as a long
    • correlationIdAsBinary

      byte[] correlationIdAsBinary()
      Get message correlation ID as an array of bytes.
      Returns:
      the message correlation ID as an array of bytes
    • correlationIdAsUuid

      UUID correlationIdAsUuid()
      Get message correlation ID as a UUID.
      Returns:
      the message correlation ID as a UUID
    • userId

      byte[] userId()
      Get user ID
      Returns:
      the user ID
    • to

      String to()
      Get the to field.
      Returns:
      the to field
    • subject

      String subject()
      Get the subject.
      Returns:
      the subject
    • replyTo

      String replyTo()
      Get the reply-to field.
      Returns:
      the reply-to field
    • messageId

      Message messageId(Object id)
      Set the message ID.
      Parameters:
      id - ID
      Returns:
      the message
    • messageId

      Message messageId(String id)
      Set the message ID (string).
      Parameters:
      id - message ID
      Returns:
      the message
    • messageId

      Message messageId(long id)
      Set the message ID (long).
      Parameters:
      id - message ID
      Returns:
      the message
    • messageId

      Message messageId(byte[] id)
      Set the message ID (array of bytes).
      Parameters:
      id - message ID
      Returns:
      the message
    • messageId

      Message messageId(UUID id)
      Set the message ID (UUID).
      Parameters:
      id - message ID
      Returns:
      the message
    • correlationId

      Message correlationId(Object correlationId)
      Set the message correlation ID.
      Parameters:
      correlationId - correlation ID
      Returns:
      the message
    • correlationId

      Message correlationId(String correlationId)
      Set the message correlation ID (string).
      Parameters:
      correlationId - correlation ID
      Returns:
      the message
    • correlationId

      Message correlationId(long correlationId)
      Set the message correlation ID (long).
      Parameters:
      correlationId - correlation ID
      Returns:
      the message
    • correlationId

      Message correlationId(byte[] correlationId)
      Set the message correlation ID (array of bytes).
      Parameters:
      correlationId - correlation ID
      Returns:
      the message
    • correlationId

      Message correlationId(UUID correlationId)
      Set the message correlation ID (UUID).
      Parameters:
      correlationId - correlation ID
      Returns:
      the message
    • userId

      Message userId(byte[] userId)
      Set the user ID.
      Parameters:
      userId - user ID
      Returns:
      the message
    • to

      Message to(String address)
      Set the to field.

      Prefer using toAddress() to build the target address.

      Parameters:
      address - to address
      Returns:
      the message
      See Also:
    • subject

      Message subject(String subject)
      Set the message subject.
      Parameters:
      subject - message subject
      Returns:
      the message
    • replyTo

      Message replyTo(String replyTo)
      Set the reply-to field.

      Prefer using replyToAddress() to build the reply-to address.

      Parameters:
      replyTo - reply-to field
      Returns:
      the message
      See Also:
    • contentType

      Message contentType(String contentType)
      Set the content-type.
      Parameters:
      contentType - content-type
      Returns:
      the message
    • contentEncoding

      Message contentEncoding(String contentEncoding)
      Set the content-encoding.
      Parameters:
      contentEncoding - content-encoding
      Returns:
      the message
    • absoluteExpiryTime

      Message absoluteExpiryTime(long absoluteExpiryTime)
      Set the expiry time.
      Parameters:
      absoluteExpiryTime - expiry time
      Returns:
      the message
    • creationTime

      Message creationTime(long creationTime)
      Set the creation time.
      Parameters:
      creationTime - creation time
      Returns:
      the message
    • groupId

      Message groupId(String groupID)
      Set the group ID.
      Parameters:
      groupID - group ID
      Returns:
      the message
    • groupSequence

      Message groupSequence(int groupSequence)
      Set the position of the message in its group.
      Parameters:
      groupSequence - group sequence
      Returns:
      the message
    • replyToGroupId

      Message replyToGroupId(String groupId)
      Set the reply-to group ID.
      Parameters:
      groupId - reply-to group ID
      Returns:
      the message
    • contentType

      String contentType()
      Get the content-type.
      Returns:
      the content-type
    • contentEncoding

      String contentEncoding()
      Get the content-encoding.
      Returns:
      the content-encoding
    • absoluteExpiryTime

      long absoluteExpiryTime()
      Get the expiry time.
      Returns:
      the expiry time
    • creationTime

      long creationTime()
      Get the creation time.
      Returns:
      the creation time
    • groupId

      String groupId()
      Get the group ID.
      Returns:
      the group ID
    • groupSequence

      int groupSequence()
      Get the message position in its group.
      Returns:
      the group sequence
    • replyToGroupId

      String replyToGroupId()
      Get the reply-to group ID.
      Returns:
      the reply-to group ID
    • property

      Object property(String key)
      Get the value of an application property.
      Parameters:
      key - property key
      Returns:
      See Also:
    • property

      Message property(String key, boolean value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, byte value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, short value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, int value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, long value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyUnsigned

      Message propertyUnsigned(String key, byte value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyUnsigned

      Message propertyUnsigned(String key, short value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyUnsigned

      Message propertyUnsigned(String key, int value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyUnsigned

      Message propertyUnsigned(String key, long value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, float value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, double value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyDecimal32

      Message propertyDecimal32(String key, BigDecimal value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyDecimal64

      Message propertyDecimal64(String key, BigDecimal value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyDecimal128

      Message propertyDecimal128(String key, BigDecimal value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, char value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertyTimestamp

      Message propertyTimestamp(String key, long value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, UUID value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, byte[] value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • property

      Message property(String key, String value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • propertySymbol

      Message propertySymbol(String key, String value)
      Set an application property.
      Parameters:
      key - property key
      value - property value
      Returns:
      the message
    • hasProperty

      boolean hasProperty(String key)
      Check an application property is set.
      Parameters:
      key - property name
      Returns:
      true if set, false otherwise
    • hasProperties

      boolean hasProperties()
      Whether at least one application property is set on the message.
      Returns:
      true if the message has at least one application property, false otherwise
    • removeProperty

      Object removeProperty(String key)
      Remove an application property.
      Parameters:
      key - property key
      Returns:
      the previous property value, if any
    • forEachProperty

      Message forEachProperty(BiConsumer<String,Object> action)
      Iterate over application properties.
      Parameters:
      action - action to execute for each application property
      Returns:
      the message
    • body

      Message body(byte[] body)
      Set the body of the message.
      Parameters:
      body - message body
      Returns:
      the message
    • body

      byte[] body()
      Get the message body.
      Returns:
      the message body
    • durable

      boolean durable()
      Whether the message is durable.
      Returns:
      true if durable, false otherwise
      See Also:
    • priority

      Message priority(byte priority)
      Set the priority of the message.
      Parameters:
      priority - message priority
      Returns:
      the message
      See Also:
    • priority

      byte priority()
      Get the message priority.
      Returns:
      the message priority
      See Also:
    • ttl

      Message ttl(Duration ttl)
      Set the message TTL.
      Parameters:
      ttl - message TTL
      Returns:
      the message
      See Also:
    • ttl

      Duration ttl()
      Get the message TTL.
      Returns:
      the message TTL
      See Also:
    • firstAcquirer

      boolean firstAcquirer()
      Whether the message may have been acquired by another link.
      Returns:
      true if the message has not been acquired by another link, false if it may have been already acquired by another link
      See Also:
    • annotation

      Object annotation(String key)
      Get the value of a message annotation.
      Parameters:
      key - annotation key
      Returns:
      the annotation value
      See Also:
    • annotation

      Message annotation(String key, Object value)
      Set the value of a message annotation.
      Parameters:
      key - annotation key
      value - annotation value
      Returns:
      the message
      See Also:
    • hasAnnotation

      boolean hasAnnotation(String key)
      Whether a message annotation is set.
      Parameters:
      key - annotation key
      Returns:
      true if the annotation is set, false otherwise
      See Also:
    • hasAnnotations

      boolean hasAnnotations()
      Whether the message has message annotation.
      Returns:
      true if the message has annotations, false otherwise
      See Also:
    • removeAnnotation

      Object removeAnnotation(String key)
      Remove an annotation.
      Parameters:
      key - annotation key
      Returns:
      the previous value of the annotation, if any
      See Also:
    • forEachAnnotation

      Message forEachAnnotation(BiConsumer<String,Object> action)
      Iterate over message annotations.
      Parameters:
      action - action to execute for each message annotation
      Returns:
      the message
    • toAddress

      AddressBuilder for the to() field.
      Returns:
      the address builder
    • replyToAddress

      AddressBuilder for the replyTo() field.
      Returns:
      the address builder