MessageBuilder

A builder for creating a {@link GenericMessage} (or {@link ErrorMessage} if the payload is of type {@link Throwable}).

@author Arjen Poutsma @author Mark Fisher @author Rossen Stoyanchev @since 4.0 @param (T) the message payload type @see GenericMessage @see ErrorMessage

Members

Functions

build
Message!(T) build()
Undocumented in source. Be warned that the author may not have intended to support it.
copyHeaders
MessageBuilder!(T) copyHeaders(Map!(string, Object) headersToCopy)

Copy the name-value pairs from the provided Map. This operation will overwrite any existing values. Use { {@link #copyHeadersIfAbsent(Map)} to avoid overwriting values. Note that the 'id' and 'timestamp' header values will never be overwritten.

copyHeadersIfAbsent
MessageBuilder!(T) copyHeadersIfAbsent(Map!(string, Object) headersToCopy)

Copy the name-value pairs from the provided Map. This operation will <em>not</em> overwrite any existing values.

removeHeader
MessageBuilder!(T) removeHeader(string headerName)

Remove the value for the given header name.

removeHeaders
MessageBuilder!(T) removeHeaders(string[] headerPatterns)

Removes all headers provided via array of 'headerPatterns'. As the name suggests the array may contain simple matching patterns for header names. Supported pattern styles are: "xxx*", "*xxx", "*xxx*" and "xxx*yyy".

setErrorChannel
MessageBuilder!(T) setErrorChannel(MessageChannel errorChannel)
Undocumented in source. Be warned that the author may not have intended to support it.
setErrorChannelName
MessageBuilder!(T) setErrorChannelName(string errorChannelName)
Undocumented in source. Be warned that the author may not have intended to support it.
setHeader
MessageBuilder!(T) setHeader(string headerName, Object headerValue)

Set the value for the given header name. If the provided value is {@code null}, the header will be removed.

setHeaderIfAbsent
MessageBuilder!(T) setHeaderIfAbsent(string headerName, Object headerValue)

Set the value for the given header name only if the header name is not already associated with a value.

setHeaders
MessageBuilder!(T) setHeaders(MessageHeaderAccessor accessor)

Set the message headers to use by providing a {@code MessageHeaderAccessor}. @param accessor the headers to use

setReplyChannel
MessageBuilder!(T) setReplyChannel(MessageChannel replyChannel)
Undocumented in source. Be warned that the author may not have intended to support it.
setReplyChannelName
MessageBuilder!(T) setReplyChannelName(string replyChannelName)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta