public interface Message
A RabbitMQ stream message must comply to the AMQP 1.0 message format for the best interoperability.
Please see section 3.2 "message format" of the AMQP 1.0 specification to find out about the exact meaning of the message sections.
Messages instances are usually created with a MessageBuilder.
| Modifier and Type | Method and Description |
|---|---|
default Message |
annotate(String key,
Object value)
Add a message annotation to the message.
|
default Message |
copy()
Create a copy of the message.
|
Map<String,Object> |
getApplicationProperties()
Get the application properties of the message.
|
Object |
getBody()
Get the message body.
|
byte[] |
getBodyAsBinary()
Get the body of the message as an array of bytes.
|
Map<String,Object> |
getMessageAnnotations()
Get the message annotations of the message.
|
Properties |
getProperties()
Get the properties of the message.
|
long |
getPublishingId()
Get the publishing ID for the message.
|
boolean |
hasPublishingId()
Does this message has a publishing ID?
|
boolean hasPublishingId()
Publishing IDs are used for de-duplication of outbound messages. They are not persisted.
long getPublishingId()
Publishing IDs are used for de-duplication of outbound messages. They are not persisted.
byte[] getBodyAsBinary()
Object getBody()
The actual type is defined by the underlying AMQP 1.0 codec.
Properties getProperties()
Map<String,Object> getApplicationProperties()
Map<String,Object> getMessageAnnotations()
Message annotations are aimed at the infrastructure, use application properties for application-specific key/value pairs.
default Message annotate(String key, Object value)
key - the message annotation keyvalue - the message annotation valuedefault Message copy()
The message copy contains the exact same instances of the original bare message (body, properties, application properties), only the message annotations are actually copied and can be modified independently.
Copyright © 2024 Broadcom Inc. and/or its subsidiaries. All rights reserved.