Posted: Fri Dec 19, 2008 3:14 am Post subject: JMS synchorinozation in message broker
Apprentice
Joined: 09 Jun 2005 Posts: 33
Hi,
We have a requirement that once we place the messages into JMS output queue back end system has pick the message and have respond with in 25 sec.if the message did not receive with in that time to the JMS input node we have to throw an exception.
so could any one suggest how to make the 2 flows to be synchoronized to calcute the 25 sec time.
Posted: Fri Dec 19, 2008 3:38 am Post subject: Re: JMS synchorinozation in message broker
Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
viswanath wrote:
We have a requirement that once we place the messages into JMS output queue back end system has pick the message and have respond with in 25 sec.if the message did not receive with in that time to the JMS input node we have to throw an exception.
so could any one suggest how to make the 2 flows to be synchoronized to calcute the 25 sec time.
Disclaimer - JMS & Java is not my strongest subject. I could be talking rubbish.
So A writes to a request queue and awaits a response on a given reply queue. B reads this request queue and has 25 seconds to respond to the specified queue. To me this can be achieved by using an MQGET with a wait of 25 seconds. AFAIK you can't do this with a JMS Input node, but you use an MQGET node to wait for the reply and dance with the headers if you needed to.
Don't forget to set the expiry on the response message in case the message arrives too late to be read.
Other and possibly better solutions are undoubtably possible. _________________ Honesty is the best policy.
Insanity is the best defence.
Thanks victor.When we use mqget node i have two questions here
1.on what basis can we pick the message.my understanding is that we can pick based on the correlation id or message id.if these are not present.is it the case that if any message arrives will mqget node able to pick the same.
2.once we use mqget jms headers will be lost.so shall i store into environmnet and play with it?
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
viswanath wrote:
1.on what basis can we pick the message.my understanding is that we can pick based on the correlation id or message id.if these are not present.is it the case that if any message arrives will mqget node able to pick the same.
The MQGET node is effectively an MQGET call wrapped up and will retrieve a message if it a) matches the message id supplied b) matches the correl id if supplied c) is the first message available on the queue if no matching criteria are supplied
viswanath wrote:
2.once we use mqget jms headers will be lost.
I thought the JMS headers (or at least the information) was stored on the message in the RFH2.
Shows what I know about Java. _________________ Honesty is the best policy.
Insanity is the best defence.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum