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 » Get the Correlation Id ?????

Post new topic  Reply to topic
 Get the Correlation Id ????? « View previous topic :: View next topic » 
Author Message
elvis_gn
PostPosted: Wed Dec 08, 2004 2:14 am    Post subject: Get the Correlation Id ????? Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi,
I am running a JAVA program which needs to take the correlation Id from the message header and put it back into another queue.

I have declared a MQMessage object 'message and that is able to put the message,if i assign a sting to it......

But the problem is i'm not able to get the correlation Id from the message itself ????

Could some one tell me the API
Back to top
View user's profile Send private message Send e-mail
slaupster
PostPosted: Wed Dec 08, 2004 5:47 am    Post subject: Reply with quote

Apprentice

Joined: 17 Nov 2004
Posts: 41

the correlid is a public byte array in MQMessage accessed with:

Code:
myMQMessage.correlationId


The API for base Java and JMS is in Using Java (SC34-6066-02) available:

http://www-306.ibm.com/software/integration/mqfamily/library/manualsa/manuals/crosslatest.html
[/code][/i]
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 08, 2004 2:04 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You are sure that you are not supposed to take the MESSAGEID of the incoming message and put it into the CorrelationID field of the outgoing message ?

Enjoy
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Wed Dec 08, 2004 2:11 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You should be able to just set your new id based on what your old id is. For example, something like:
Code:

MQMessage msg = new MQMessage(); /* get a new message */
MQPutMessageOptions pmo = new MQPutMessageOptions(); /* get a new PMO */
pmo.options = MQC.MQPMO_NEW_MSG_ID | MQC.MQPMO_NEW_CORREL_ID; /* we want new msg, correl id's */

qServer.put(msg, pmo); /* put the message */

MQMessage msgReply = new MQMessage(); /* get a new message */
msgReply.messageId = msg.messageId; /* copy the put message id to the new message's message id */


And, I suspect that fjb_saper is right about what you want to do. The normal pattern is to reply to a message and move the incoming message's message id to the outgoing message's correlation id.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Get the Correlation Id ?????
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.