The <publish-subscribe-channel/>
helps you:
<publish-subscribe-channel id="storeMessageChannel"/>
<int-ws:inbound-gateway request-channel="storeMessageChannel"/>
<int-jms:outbound-channel-adapter channel="storeMessageChannel"/>
<int:transformer input-channel="storeMessageChannel" expression="'OK'"/>
Well, in this case the message from WS will be sent to the storeMessageChannel
with two sequential subscribers: 1. JMS - to place message to the queue; 2. Simple transformer - to return to the WS response 'OK'.
Transformer will apply the message only after jms outbound adapter has done its work.