Package com.rabbitmq.stream
Interface MessageBuilder
-
- All Known Implementing Classes:
WrapperMessageBuilder
public interface MessageBuilder
API to configure and create aMessage
.A
MessageBuilder
is meant to create only one message, it should not be re-used for several message instances.Please see section 3.2 "message format" of the AMQP 1.0 specification to find out about the exact meaning of the message sections.
- See Also:
Message
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MessageBuilder.ApplicationPropertiesBuilder
API to set application properties.static interface
MessageBuilder.MessageAnnotationsBuilder
API to set message annotations.static interface
MessageBuilder.PropertiesBuilder
API to set message properties.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessageBuilder
addData(byte[] data)
Set binary data of the message.MessageBuilder.ApplicationPropertiesBuilder
applicationProperties()
The builder to set application properties.Message
build()
Create the message.MessageBuilder.MessageAnnotationsBuilder
messageAnnotations()
The builder to set message annotations.MessageBuilder.PropertiesBuilder
properties()
The builder forProperties
.MessageBuilder
publishingId(long publishingId)
Set the publishing ID (for deduplication).
-
-
-
Method Detail
-
build
Message build()
Create the message.- Returns:
- the message
-
publishingId
MessageBuilder publishingId(long publishingId)
Set the publishing ID (for deduplication).This is value is used only for outbound messages and is not persisted.
- Parameters:
publishingId
-- Returns:
- this builder instance
- See Also:
ProducerBuilder.name(String)
, Deduplication documentation
-
properties
MessageBuilder.PropertiesBuilder properties()
The builder forProperties
.- Returns:
- the properties builder
- See Also:
Message.getProperties()
-
applicationProperties
MessageBuilder.ApplicationPropertiesBuilder applicationProperties()
The builder to set application properties.- Returns:
- the application properties builder
- See Also:
Message.getApplicationProperties()
-
messageAnnotations
MessageBuilder.MessageAnnotationsBuilder messageAnnotations()
The builder to set message annotations.- Returns:
- the message annotations builder
- See Also:
Message.getMessageAnnotations()
-
addData
MessageBuilder addData(byte[] data)
Set binary data of the message.- Parameters:
data
-- Returns:
- this builder instance
- See Also:
Message.getBodyAsBinary()
-
-