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 » General IBM MQ Support » Setting right corelation id

Post new topic  Reply to topic
 Setting right corelation id « View previous topic :: View next topic » 
Author Message
gajanank
PostPosted: Tue Dec 04, 2007 9:49 pm    Post subject: Setting right corelation id Reply with quote

Newbie

Joined: 04 Dec 2007
Posts: 1

I am new to MQ so pardon me if this looks very simple.

Scenario
1. Lotus Notes Application receives message from other MQ application
2. Lotues Notes Java agent processes the MQMessage and sends the reply back to sender application.

Problem
When sending reply back , client application expects message id of the original message copied to coorelation id of message which my application should be sending.

However coorelation id is not getting copied correctly.

MQMessage mqMsg = new MQMessage();
mqMsg.format = MQC.MQFMT_STRING;
mqMsg.messageId = messageID.getBytes();
mqMsg.correlationId = messageID.getBytes();
mqMsg.characterSet = 1208;
mqMsg.report = MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID;
mqMsg.writeString(message);
MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID ;

System.out.println("before sending message");
qName.put(mqMsg, pmo);
System.out.println("message successfully sent");

mqMsg.correlationId = mqMsg.messageId;
messageId = new String(mqMsg.messageId);

System.out.println(" Message id of received message is "+ messageID );
System.out.println(" Coorealtion id of sent message is "+ toHexString(mqMsg.correlationId) );

message id of receiving message is not same as coorelation id of message I am sending?

am I missing something here?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Dec 05, 2007 1:25 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

I am new to Java so pardon me if I make a simple mistake.

If the code you quote is, as I believe, the Lotus Notes Java trying to do the reply there's no reference to the received message. The correl id seems to be set from the message id following the put.

Also never treat either the message id or the correl id as a string. It's a byte array and should certainly be copied as such to prevent conversion, and printed as a hex string.

Have you looked at any of the sample code provided? It may offer useful insights into your requirement.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Dec 05, 2007 2:55 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Do not set a Report Option value in the Put Message Options.

The only PMO you need is to set MQPMO_NO_SYNCPOINT (which is the default on non-mainframes although best practice to explicitly set).
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Dec 05, 2007 4:21 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

You should set MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID in the MQMD's Report field.

And then the Lotus Notes Java agent process has to respect that field and take the appropriate action when building the reply message based off of you request message.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 05, 2007 5:21 pm    Post subject: Reply with quote

Grand High Poobah

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

In base MQ doesn't he also have to set the pmo option Set CorrelID ??
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Setting right corelation 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.