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.