Class MessageBuilder<T>
java.lang.Object
org.springframework.integration.support.AbstractIntegrationMessageBuilder<T>
org.springframework.integration.support.BaseMessageBuilder<T,MessageBuilder<T>>
 
org.springframework.integration.support.MessageBuilder<T>
- Type Parameters:
- T- the payload type.
The default message builder; creates immutable 
GenericMessages.
 Named MessageBuilder instead of DefaultMessageBuilder for backwards
 compatibility.- Author:
- Arjen Poutsma, Mark Fisher, Oleg Zhurakousky, Dave Syer, Gary Russell, Artem Bilan
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> MessageBuilder<T>fromMessage(Message<T> message) Create a builder for a newMessageinstance pre-populated with all the headers copied from the provided message.static <T> MessageBuilder<T>withPayload(T payload) Create a builder for a newMessageinstance with the provided payload.Methods inherited from class org.springframework.integration.support.BaseMessageBuilderbuild, copyHeaders, copyHeadersIfAbsent, getCorrelationId, getHeader, getHeaders, getPayload, getSequenceDetails, getSequenceNumber, getSequenceSize, popSequenceDetails, pushSequenceDetails, readOnlyHeaders, removeHeader, removeHeaders, setCorrelationId, setErrorChannel, setErrorChannelName, setExpirationDate, setExpirationDate, setHeader, setHeaderIfAbsent, setPriority, setReplyChannel, setReplyChannelName, setSequenceNumber, setSequenceSizeMethods inherited from class org.springframework.integration.support.AbstractIntegrationMessageBuildercloneMessageHistoryIfAny, filterAndCopyHeadersIfAbsent
- 
Method Details- 
fromMessageCreate a builder for a newMessageinstance pre-populated with all the headers copied from the provided message. The payload of the provided Message will also be used as the payload for the new message.- Type Parameters:
- T- The type of the payload.
- Parameters:
- message- the Message from which the payload and all headers will be copied
- Returns:
- A MessageBuilder.
 
- 
withPayloadCreate a builder for a newMessageinstance with the provided payload.- Type Parameters:
- T- The type of the payload.
- Parameters:
- payload- the payload for the new message
- Returns:
- A MessageBuilder.
 
 
-