|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
C++ API setCorrelationId/setMessageId help |
« View previous topic :: View next topic » |
Author |
Message
|
tom10550 |
Posted: Wed Aug 17, 2005 5:05 am Post subject: C++ API setCorrelationId/setMessageId help |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Aug 17, 2005 5:10 am Post subject: |
|
|
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 |
|
 |
clindsey |
Posted: Wed Aug 17, 2005 5:25 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
|
Back to top |
|
 |
Nigelg |
Posted: Wed Aug 17, 2005 6:29 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|