public final class MessageBuilder extends MessageBuilderSupport<Message>
Modifier and Type | Method and Description |
---|---|
MessageBuilder |
andProperties(MessageProperties properties)
Makes this builder's properties builder use a reference to properties.
|
Message |
build() |
static MessageBuilder |
fromClonedMessage(Message message)
The final message will have a copy of the message
body, the MessageProperties will be cloned (top level only).
|
static MessageBuilder |
fromMessage(Message message)
The final message body will be a direct reference to the message
body, the MessageProperties will be a shallow copy.
|
static MessageBuilder |
withBody(byte[] body)
The final message body will be a direct reference to 'body'.
|
static MessageBuilder |
withBody(byte[] body,
int from,
int to)
The final message body will be a new array containing the byte range from
'body'.
|
static MessageBuilder |
withClonedBody(byte[] body)
The final message body will be a copy of 'body' in a new array.
|
buildProperties, copyHeaders, copyHeadersIfAbsent, copyProperties, removeHeader, removeHeaders, setAppId, setAppIdIfAbsent, setClusterId, setClusterIdIfAbsent, setContentEncoding, setContentEncodingIfAbsent, setContentLength, setContentLengthIfAbsent, setContentType, setContentTypeIfAbsentOrDefault, setCorrelationId, setCorrelationIdIfAbsent, setDeliveryMode, setDeliveryModeIfAbsentOrDefault, setDeliveryTag, setDeliveryTagIfAbsent, setExpiration, setExpirationIfAbsent, setHeader, setHeaderIfAbsent, setMessageCount, setMessageCountIfAbsent, setMessageId, setMessageIdIfAbsent, setPriority, setPriorityIfAbsentOrDefault, setProperties, setReceivedExchange, setReceivedExchangeIfAbsent, setReceivedRoutingKey, setReceivedRoutingKeyIfAbsent, setRedelivered, setRedeliveredIfAbsent, setReplyTo, setReplyToAddress, setReplyToAddressIfAbsent, setReplyToIfAbsent, setTimestamp, setTimestampIfAbsent, setType, setTypeIfAbsent, setUserId, setUserIdIfAbsent
public static MessageBuilder withBody(byte[] body)
body
- The body.public static MessageBuilder withClonedBody(byte[] body)
body
- The body.public static MessageBuilder withBody(byte[] body, int from, int to)
body
- The body.from
- The starting index.to
- The ending index.Arrays.copyOfRange(byte[], int, int)
public static MessageBuilder fromMessage(Message message)
message
- The message.public static MessageBuilder fromClonedMessage(Message message)
message
- The message.public MessageBuilder andProperties(MessageProperties properties)
properties
- The properties.public Message build()
build
in class MessageBuilderSupport<Message>