As an example I have used a simplified version of Cafe Sample Application that are shipped with Spring Integration bundle, but adding MongoDB MessageStore.
Next important piece of code is Cafe interface. This class acts as a facade for placing orders and not explained yet, for retrieving orders. Let's see this class:
And now you are ready to send orders using Cafe interface and receiving at console output not the order but an UUID.
And our "test" now looks like: