|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
unique MSGID |
« View previous topic :: View next topic » |
Author |
Message
|
mountisland |
Posted: Tue May 06, 2008 10:13 am Post subject: unique MSGID |
|
|
Newbie
Joined: 14 Sep 2007 Posts: 3
|
Hi,
I am sending a msg that contains 2 idocs, each idoc beginning with the segment EDI_DC40. The utility program that we use first connects to an outbound queue, then opens the queue. The following code is used to set the msgid and correlid flags,
memcpy(Message_Descriptor.MsgId, MQMI_NONE, sizeof(MQMI_NONE));
memcpy(Message_Descriptor.CorrelId, MQCI_NONE, sizeof(MQCI_NONE));
Then we loop for each idoc
in the loop, we carry out a MQPUT
finally at the end , we call an MQCLOSE
We are finding that that for each idoc, a message is being created in the queue. However, all of the msgs have the same msgid.
I thought that the queue manager would automatically generate a unique msg id every time an MQPUT function is called, especially is the MsgID and CorrelID flags are set to MQMI_NONE.
Is there any setting on the queue manager itself that is needed to force a msg id to be created every time a new message is put onto a queue? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 06, 2008 1:58 pm Post subject: Re: unique MSGID |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mountisland wrote: |
Hi,
I am sending a msg that contains 2 idocs, each idoc beginning with the segment EDI_DC40. The utility program that we use first connects to an outbound queue, then opens the queue. The following code is used to set the msgid and correlid flags,
memcpy(Message_Descriptor.MsgId, MQMI_NONE, sizeof(MQMI_NONE));
memcpy(Message_Descriptor.CorrelId, MQCI_NONE, sizeof(MQCI_NONE));
Then we loop for each idoc
in the loop, we carry out a MQPUT
finally at the end , we call an MQCLOSE
We are finding that that for each idoc, a message is being created in the queue. However, all of the msgs have the same msgid.
I thought that the queue manager would automatically generate a unique msg id every time an MQPUT function is called, especially is the MsgID and CorrelID flags are set to MQMI_NONE.
Is there any setting on the queue manager itself that is needed to force a msg id to be created every time a new message is put onto a queue? |
You need to reset the msgid and correlid inside the loop. If you do not reset the value before each put the sequence is as follows
1st put clear... after put contains msgid and correlid.
2nd put msgid and correlid from 1st put.. setting those unchanged after put...
nth put msgid and correlid from 1st put.. setting those unchanged after put...
Enjoy  _________________ MQ & Broker admin |
|
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
|
|
|
|