Author |
Message
|
jmw |
Posted: Wed Apr 27, 2005 11:55 am Post subject: Message correlation. |
|
|
Novice
Joined: 16 Apr 2003 Posts: 19
|
Using Jms, how do I do the request message and reply message corelation, if I can not use the MQCorrelationID field?
Thanks, |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 27, 2005 12:51 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Why do you think you can't use the Correlation ID? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vin |
Posted: Wed Apr 27, 2005 6:31 pm Post subject: |
|
|
Master
Joined: 25 Mar 2002 Posts: 212 Location: India
|
did you look at the temporary dynamic queues which could be used for the request/reply scenario. you create a temporary queue and use the name in the replyTo queue field of the message, the responder would read this queue and populate it with all the response messages after which the temporary queue is deleted |
|
Back to top |
|
 |
clindsey |
Posted: Wed Apr 27, 2005 6:45 pm Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
This is your lucky day. There are a pair of samples to show you exactly how to do this with jms. Go to http://www.developer.ibm.com/tech/sampmq.html
and scroll down the page until you find mqjmsreq.java and mqjmssrv.java.
Charlie
Last edited by clindsey on Thu Apr 28, 2005 5:11 am; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Apr 27, 2005 7:09 pm Post subject: Re: Message correlation. |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
MQ@net wrote: |
Using Jms, how do I do the request message and reply message corelation, if I can not use the MQCorrelationID field?
Thanks, |
What in your requirement is preventing you to use the industry accepted pattern :: use the correlation ID ?
 |
|
Back to top |
|
 |
jmw |
Posted: Thu Apr 28, 2005 2:59 am Post subject: |
|
|
Novice
Joined: 16 Apr 2003 Posts: 19
|
As the server application put the request message id into reply messge id and reply correlation id, I can set the messag id in JMS. So the client have no way to crorelate the message. |
|
Back to top |
|
 |
jmw |
Posted: Thu Apr 28, 2005 3:02 am Post subject: |
|
|
Novice
Joined: 16 Apr 2003 Posts: 19
|
HI ALL, any one know how to use selector in MQ Base ? or is there any similiar function in MQ base? Thanks, |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 28, 2005 3:27 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are you writing the server or the client?
The only selector functionality you get in the Java API for WebSphere MQ is the standard MQ match options - which allow you to match on MsgId or CorrelID.
And unlike JMS selectors, these are reasonably speedy operations. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jmw |
Posted: Thu Apr 28, 2005 4:52 am Post subject: |
|
|
Novice
Joined: 16 Apr 2003 Posts: 19
|
Thanks for reply. I am writing client application. Do you have the URL I can download the MQ Base class from? Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 28, 2005 5:03 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you're writing the client, then by normal practices in a request/reply scenario, you should store the message ID of the message that you sent - which should be generated by the system and WILL BE returned to you somewhere, and match it against the correlation ID of the reply.
Note that this does not require you to SET the Message ID. Just save the one that is returned to you - in JMS/Java, I believe the Message object that was sent is updated with the new message ID.
You can download the Java API from here, or here. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|