ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Message correlation.

Post new topic  Reply to topic
 Message correlation. « View previous topic :: View next topic » 
Author Message
jmw
PostPosted: Wed Apr 27, 2005 11:55 am    Post subject: Message correlation. Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Apr 27, 2005 12:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vin
PostPosted: Wed Apr 27, 2005 6:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
clindsey
PostPosted: Wed Apr 27, 2005 6:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Apr 27, 2005 7:09 pm    Post subject: Re: Message correlation. Reply with quote

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
View user's profile Send private message Send e-mail
jmw
PostPosted: Thu Apr 28, 2005 2:59 am    Post subject: Reply with quote

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
View user's profile Send private message
jmw
PostPosted: Thu Apr 28, 2005 3:02 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 28, 2005 3:27 am    Post subject: Reply with quote

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
View user's profile Send private message
jmw
PostPosted: Thu Apr 28, 2005 4:52 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 28, 2005 5:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Message correlation.
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.