There's often a need to temporarily store transient messages during design of Spring Integration flows - several different mechanisms are available in the toolkit.
It's pretty straight forward to take a message, use an SI header enricher construct and place the message in the header using a SpEL expression - in fact one for the header key name and one for the payload extraction.
The following SI flow demonstrates an example of how to do just that :
This example can be executed by implementing a gateway as follows:
and then running a test such as this one:
For full source code and configuration, see the header-management maven module under git://github.com/L8MDV/l8mdv-si-samples.git