In this blog I have demonstrated how to set JMS Queues in Receiver JMS channel using ReplyTo Destination method.
Let’s consider a synchronous scenario where different users from different geographical location will perform promotion inquiry. The request message will be sent from web application to R/3 via JMS & XI and response from R/3 will be sent back to web application in same manner via XI & JMS.
There is no problem if there is just one user performing the enquiry because then we can send back the response to one particular JMS Queue but the problem comes when we have to send the response to different users at different geographical location because in this case just one JMS Queue will not be sufficient. So, to solve this problem we will use “JMS Message ReplyTo Destination” method.
In this method the receiver queue name is set in the JMS header of sender communication channel and after doing some settings in both sender and receiver channels the receiver channels delivers the response message to respective queues.
So here is the step by step procedure…
Step1. JMS Sender Communication Channel Settings.
Jump to Advanced tab and set the Adapter-Specific Message Attributes (ASMA) settings and select the “JMS Message ReplyTo Destination” box as shown below.
Step2. JMS Receiver Communication Channels Settings.
Since JMS Queue is mandatory field and we cannot leave it blank. So we need to specify one default queue which will be provided by MQ like in our case we are using “SYSTEM.DEFAULT.LOCAL.QUEUE”.
Now jump to Advanced tab and set the ASMA settings. Under Additional Parameters add a parameter as “JMS.Message.DynamicDestination” and its value as “true” (use lower case for the value) as shown below. That’s it you are done!
Whenever any user from web application will sent request message, the response queue name will come under Dynamic Configuration of Sender Communication Channel as shown below and receiver channels will read this queue name from here.