Author |
Message
|
cambers |
Posted: Wed Jun 19, 2002 1:08 pm Post subject: Retrieving a reply message using JMS |
|
|
Newbie
Joined: 19 Jun 2002 Posts: 2
|
Hi,
i am fresh to JMS and MQ and have maybe a simple question on request/reply PTP messaging.
i have a client app that fires off requests to a server which in turn sends back a reply (populating the correlation Id based on the request's message Id).
back on client, i now want to obtain the reply message from the queue by testing the correlation Id. what would be the best way to obtain a specific message off the reply queue using JMS (basically, i'm hoping to get to grips with best design/code practice for message polling or use of QueueRequestor or a MessageListener; not considering message-driven beans).
Any advice or pointer to sample code much appreciated. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Jun 20, 2002 5:59 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
The mqjmsreq.java and mqjmssrv.java samples in the Software Repository act as a requestor/server. However, they don't do anything with the message id/correlation id. You might be able to start with them. |
|
Back to top |
|
 |
granthmuk |
Posted: Mon Jun 24, 2002 12:45 am Post subject: |
|
|
 Apprentice
Joined: 16 May 2001 Posts: 38 Location: Edinburgh, Scotland
|
From our experience using the CorrelId as a JMS selector did not scale at all well. We are using the underlying MQ Classes to get messages with Correlid and this is performing OK. |
|
Back to top |
|
 |
cambers |
Posted: Mon Jun 24, 2002 8:11 am Post subject: |
|
|
Newbie
Joined: 19 Jun 2002 Posts: 2
|
Thanks for your advice - this was one of my concerns. I'd be interested in others experience of using JMS message selectors in enterprise applications. Did you feel this justified ditching JMS altogether in favour of MQ base classes? |
|
Back to top |
|
 |
Naftalanja |
Posted: Fri Jun 28, 2002 4:22 pm Post subject: |
|
|
Acolyte
Joined: 30 Jan 2002 Posts: 63 Location: Los Angeles
|
May be using the QueueBrowser from com.ibm.mq.jms.* package would be nice. I was able to browse 5000 messages and checking for the message which has matching corr id (i was typically looking for corr id of 5000th message) in aroun 20 sec. Which is not very bad though, but safe i guess. hope this helps thanks |
|
Back to top |
|
 |
|