13.3 Inbound Gateway

Spring Integration's message-driven JmsInboundGateway delegates to a MessageListener container, supports dynamically adjusting concurrent consumers, and can also handle replies. The JmsInboundGateway requires references to a ConnectionFactory, and a Destination (or 'destinationName'). The following example defines a JmsInboundGateway that receives from the JMS queue called "exampleQueue" and sends to the Spring Integration channel named "exampleChannel".

<jms:inbound-gateway id="jmsInGateway" destination="inQueue" request-channel="exampleChannel"/>

[Note]Note
The default behavior for an outbound gateway is to reply with the Spring Integration Message as the JMS Message body. This works well when you are connecting two systems that are both running Spring Integration-based applications. However, if you prefer to just send the Spring Integration Message's payload as the JMS reply Message's body, then set the "extract-payload-for-reply" attribute to "true".