Here is the Spring Integration I was coming up with today, if you find things which could be improved please follow up.
On the client side the messages can be send out and received through a SimpleMessagingGateway:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:integration="http://www.springframework.org/schema/integration"
xmlns:jms="http://www.springframework.org/schema/integration/jms"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
<import resource="integration-common.xml"/>
<!-- Communication Gateway for the Client (send/receive) -->
<bean id="gateway" class="org.springframework.integration.gateway.SimpleMessagingGateway">
<property name="requestChannel" ref="SenderChannel"/>
<property name="replyChannel" ref="InboundChannel"/>
<property name="replyTimeout" value="1000"/>
</bean><!-- TODO: could use integration:gateway -->
<!-- Sending out message to JMS request queue -->
<integration:channel id="SenderChannel"/>
<jms:outbound-channel-adapter
channel="SenderChannel"
destination="requestQueue" />
<!-- Listen to incoming messages on JMS reply queue -->
<integration:channel id="InboundChannel">
<integration:queue/>
</integration:channel>
<jms:message-driven-channel-adapter
destination="replyQueue"
channel="InboundChannel" />
</beans>
And the configuration on the processing node side looks like (please see the comments inline for more explanation of the Spring Integration elements):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:integration="http://www.springframework.org/schema/integration"
xmlns:jms="http://www.springframework.org/schema/integration/jms"
xmlns:stream="http://www.springframework.org/schema/integration/stream"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/integration/jms
http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
<import resource="integration-common.xml"/>
<!-- Read in Message Endpoint Service Activator classes -->
<context:component-scan base-package="sample.integration.jmsbasic"/>
<!-- Listen to incoming messages on the JMS request queue -->
<integration:channel id="jmsinToProcChannel"/>
<jms:message-driven-channel-adapter
destination="requestQueue"
channel="jmsinToProcChannel"/>
<!-- Delegate message to service implementation and take care of answer -->
<integration:service-activator
input-channel="jmsinToProcChannel"
ref="procService"
output-channel="jmsBackChannel" />
<!-- Send answer back to JMS reply queue -->
<integration:channel id="jmsBackChannel"/>
<jms:outbound-channel-adapter
channel="jmsBackChannel"
destination="replyQueue" />
</beans>