1
votes

I am making a simple spring integration app that sends a message to configurable jms queue, and receives messages from a different configurable jms queue.

I am able to make the outbound jms adapter queue configurable with "destination-expression", but since this would not work for an inbound adapter, I am unsure of how to do this.

1

1 Answers

0
votes

Well, you misunderstood the concept a bit.

In the <int-jms:outbound-channel-adapter> we can send to any destination according to the requestMessage. Just because we have the control over there and we are outside of JMS.

On the <int-jms:inbound-channel-adapter> we can't change/dance with the destination because there is no incoming context from our application. This kind of adapter is the entry point to the SI application. So, if you change the destination at runtime, you'll miss messages from the previous destination.

Although yes, you can change it using JmsDestinationPollingSource.setDestination()/setDestinationName(). You can achieve that referring the bean like [INBOUND_CHANNEL_ADAPTER_ID].source.

You can't listen to the several destination from one consumer in JMS, BTW. So, you really are forced to have several inbound adapters in your application.