I have two jms:inbound gateways listening to two different queuemanagers/queue but sharing the same inbound/error/outbound channel. Once the message is picked up and processed the gateway has to respond based on the JMSReplyTo header(processing is the same way its just that we have queuemanagers on different hosts). Since the outbond channel is same, how will the gateways differentiate between which response queue to send. So question is does the gateways maintain its own instance of the channels? If not should I have different set of inbound/error/outbound channels for both the gateways so that the sender gets the correct response or is there a better solution. Please advice.
<int-jms:inbound-gateway id="test1"
request-channel="inbouldChannel"
reply-channel="outboundChannel"
error-channel="errorChannel"
header-mapper="headerMapper"
container="listenerContainer1"/>
<int-jms:inbound-gateway id="test2"
request-channel="inbouldChannel"
reply-channel="outboundChannel"
error-channel="errorChannel"
header-mapper="headerMapper"
container="listenerContainer2"/>