15. JMS Support

Spring Integration provides Channel Adapters for receiving and sending JMS messages. The inbound Channel Adapter uses Spring's JmsTemplate to receive based on a polling period, and the outbound Channel Adapter uses the JmsTemplate to convert and send a JMS Message on demand.

Spring Integration also provides inbound and outbound JMS Gateways. The inbound gateway relies on Spring's DefaultMessageListenerContainer for Message-driven reception that is also capable of sending a return value to the "reply-to" Destination as provided by the received Message. The outbound Gateway uses a JMS QueueRequestor for request/reply operations. In other words, while the inbound and outbound Channel Adapters are for unidirectional Messaging, the Gateways are intended for handling request/reply operations.

15.1 Inbound Channel Adapter

The inbound Channel Adapter requires a reference to either a single JmsTemplate instance or both ConnectionFactory and Destination (a 'destinationName' can be provided in place of the 'destination' reference). The following example defines an inbound Channel Adapter with a Destination reference.

<jms:inbound-channel-adapter id="jmsIn" destination="inQueue" channel="exampleChannel"/>