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 API Support » C++ API setCorrelationId/setMessageId help

Post new topic  Reply to topic
 C++ API setCorrelationId/setMessageId help « View previous topic :: View next topic » 
Author Message
tom10550
PostPosted: Wed Aug 17, 2005 5:05 am    Post subject: C++ API setCorrelationId/setMessageId help Reply with quote

Newbie

Joined: 17 Aug 2005
Posts: 1

I am using the following code on Windows 2000 with the Websphere MQ 6.0 server and API libarary:

ImqMessage msg;

msg.setFormat( MQFMT_STRING );
msg.useFullBuffer(msgData,msgLength);
msg.setReplyToQueueManagerName(replyToQueueManagerName);
msg.setReplyToQueueName(replyToQueueName);
msg.setCorrelationId(ImqBinary(correlId,MQ_CORREL_ID_LENGTH)); // correlId is a MQ_CORREL_ID_LENGTH string
msg.setMessageId(ImqBinary(msgId,MQ_MSG_ID_LENGTH)); // msgId is a MQ_MSG_ID_LENGTH string

queue.put(msg);


The queue is defined as a remote queue. By stopping the transmission channel, I am able to look at the transmission queue and I see that the correlation id has been set to the message id that I had passed and that the message id has been given a system generated id. I am very new to MQ Series and was wondering if anyone could tell me what is going on?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 17, 2005 5:10 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Don't look at the transmission queue. Write to a qlocal and look at that.

Look very closely at the samples that are available.

Look very closely at the prototypes for setCorrelationID and setMessageID, and remember that neither value holds a String, they hold a 24 byte binary value!
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
clindsey
PostPosted: Wed Aug 17, 2005 5:25 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Take a look at the samples at http://www.developer.ibm.com/tech/sampmq.html

The c++ samples for handling msgid and correlid are mqreqro.cpp and mqsrvro.cpp

These are also available at Roger's site www.Capitalware.biz. Click on pc downloads

Charlie
Back to top
View user's profile Send private message
Nigelg
PostPosted: Wed Aug 17, 2005 6:29 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

It is correct that a msg on the xmitq has a system-generated MsgId, and a CorrelID of the Msgd passed in. Look closer at the msg data, and you will see that the MQXQH header of the msg has an embedded MQMD, and this MD has the MsgId and CorrelId that you created. The fields in the embedded MQMD are used to create the msg on the destination qmgr.

Are you really sure that you want to create your own MsgIds? WMQ is actually very good at creating unique MsgIds for you. The recommended and preferred route is for you to create your own CorrelIds to track msgs.
_________________
MQSeries.net helps those who help themselves..
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 API Support » C++ API setCorrelationId/setMessageId help
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.