Package com.rabbitmq.client.amqp
Interface Message
public interface Message
AMQP 1.0 message.
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Get the expiry time.absoluteExpiryTime
(long absoluteExpiryTime) Set the expiry time.annotation
(String key) Get the value of a message annotation.annotation
(String key, Object value) Set the value of a message annotation.byte[]
body()
Get the message body.body
(byte[] body) Set the body of the message.Get the content-encoding.contentEncoding
(String contentEncoding) Set the content-encoding.Get the content-type.contentType
(String contentType) Set the content-type.Get message correlation ID.correlationId
(byte[] correlationId) Set the message correlation ID (array of bytes).correlationId
(long correlationId) Set the message correlation ID (long).correlationId
(Object correlationId) Set the message correlation ID.correlationId
(String correlationId) Set the message correlation ID (string).correlationId
(UUID correlationId) Set the message correlation ID (UUID).byte[]
Get message correlation ID as an array of bytes.long
Get message correlation ID as a long.Get message correlation ID as a string.Get message correlation ID as a UUID.long
Get the creation time.creationTime
(long creationTime) Set the creation time.boolean
durable()
Whether the message is durable.boolean
Whether the message may have been acquired by another link.forEachAnnotation
(BiConsumer<String, Object> action) Iterate over message annotations.forEachProperty
(BiConsumer<String, Object> action) Iterate over application properties.groupId()
Get the group ID.Set the group ID.int
Get the message position in its group.groupSequence
(int groupSequence) Set the position of the message in its group.boolean
hasAnnotation
(String key) Whether a message annotation is set.boolean
Whether the message has message annotation.boolean
Whether at least one application property is set on the message.boolean
hasProperty
(String key) Check an application property is set.Get message ID.messageId
(byte[] id) Set the message ID (array of bytes).messageId
(long id) Set the message ID (long).Set the message ID.Set the message ID (string).Set the message ID (UUID).byte[]
Get message ID as an array of bytes.long
Get message ID as a long.Get message ID as a string.Get message ID as a UUID.byte
priority()
Get the message priority.priority
(byte priority) Set the priority of the message.Get the value of an application property.Set an application property.Set an application property.Set an application property.Set an application property.Set an application property.Set an application property.Set an application property.Set an application property.Set an application property.Set an application property.Set an application property.propertyDecimal128
(String key, BigDecimal value) Set an application property.propertyDecimal32
(String key, BigDecimal value) Set an application property.propertyDecimal64
(String key, BigDecimal value) Set an application property.propertySymbol
(String key, String value) Set an application property.propertyTimestamp
(String key, long value) Set an application property.propertyUnsigned
(String key, byte value) Set an application property.propertyUnsigned
(String key, int value) Set an application property.propertyUnsigned
(String key, long value) Set an application property.propertyUnsigned
(String key, short value) Set an application property.removeAnnotation
(String key) Remove an annotation.removeProperty
(String key) Remove an application property.replyTo()
Get the reply-to field.Set the reply-to field.AddressBuilder
for thereplyTo()
field.Get the reply-to group ID.replyToGroupId
(String groupId) Set the reply-to group ID.subject()
Get the subject.Set the message subject.to()
Get the to field.Set the to field.AddressBuilder
for theto()
field.ttl()
Get the message TTL.Set the message TTL.byte[]
userId()
Get user IDuserId
(byte[] userId) Set the user ID.
-
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
Set the message ID.- Parameters:
id
- ID- Returns:
- the message
-
messageId
Set the message ID (string).- Parameters:
id
- message ID- Returns:
- the message
-
messageId
Set the message ID (long).- Parameters:
id
- message ID- Returns:
- the message
-
messageId
Set the message ID (array of bytes).- Parameters:
id
- message ID- Returns:
- the message
-
messageId
Set the message ID (UUID).- Parameters:
id
- message ID- Returns:
- the message
-
correlationId
Set the message correlation ID.- Parameters:
correlationId
- correlation ID- Returns:
- the message
-
correlationId
Set the message correlation ID (string).- Parameters:
correlationId
- correlation ID- Returns:
- the message
-
correlationId
Set the message correlation ID (long).- Parameters:
correlationId
- correlation ID- Returns:
- the message
-
correlationId
Set the message correlation ID (array of bytes).- Parameters:
correlationId
- correlation ID- Returns:
- the message
-
correlationId
Set the message correlation ID (UUID).- Parameters:
correlationId
- correlation ID- Returns:
- the message
-
userId
Set the user ID.- Parameters:
userId
- user ID- Returns:
- the message
-
to
Set the to field.Prefer using
toAddress()
to build the target address.- Parameters:
address
- to address- Returns:
- the message
- See Also:
-
subject
Set the message subject.- Parameters:
subject
- message subject- Returns:
- the message
-
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
Set the content-type.- Parameters:
contentType
- content-type- Returns:
- the message
-
contentEncoding
Set the content-encoding.- Parameters:
contentEncoding
- content-encoding- Returns:
- the message
-
absoluteExpiryTime
Set the expiry time.- Parameters:
absoluteExpiryTime
- expiry time- Returns:
- the message
-
creationTime
Set the creation time.- Parameters:
creationTime
- creation time- Returns:
- the message
-
groupId
Set the group ID.- Parameters:
groupID
- group ID- Returns:
- the message
-
groupSequence
Set the position of the message in its group.- Parameters:
groupSequence
- group sequence- Returns:
- the message
-
replyToGroupId
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
Get the value of an application property.- Parameters:
key
- property key- Returns:
- See Also:
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyUnsigned
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyUnsigned
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyUnsigned
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyUnsigned
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyDecimal32
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyDecimal64
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyDecimal128
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertyTimestamp
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
property
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
propertySymbol
Set an application property.- Parameters:
key
- property keyvalue
- property value- Returns:
- the message
-
hasProperty
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
Remove an application property.- Parameters:
key
- property key- Returns:
- the previous property value, if any
-
forEachProperty
Iterate over application properties.- Parameters:
action
- action to execute for each application property- Returns:
- the message
-
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
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
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
Get the value of a message annotation.- Parameters:
key
- annotation key- Returns:
- the annotation value
- See Also:
-
annotation
Set the value of a message annotation.- Parameters:
key
- annotation keyvalue
- annotation value- Returns:
- the message
- See Also:
-
hasAnnotation
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
Remove an annotation.- Parameters:
key
- annotation key- Returns:
- the previous value of the annotation, if any
- See Also:
-
forEachAnnotation
Iterate over message annotations.- Parameters:
action
- action to execute for each message annotation- Returns:
- the message
-
toAddress
Message.MessageAddressBuilder toAddress()AddressBuilder
for theto()
field.- Returns:
- the address builder
-
replyToAddress
Message.MessageAddressBuilder replyToAddress()AddressBuilder
for thereplyTo()
field.- Returns:
- the address builder
-