Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems setting MsgId before MQPUT

Status
Not open for further replies.

jbmjlm10

Programmer
Jun 16, 2004
11
US
Hi,
I have 2 files and I want to put file 1 into queue A and file 2 into queue B. I'm doing this with one C program. I'm putting each record into queue A and I'm letting MQ generate a unique MsgId for each record. For each put to queue A, I'm saving the MsgId, so that I can use it to put the corresponding record of file 2 into queue B. I'm saving the MsgId, before the MQPUT to queue A like this:
memcpy(save_msgid, md.MsgId, sizeof(md.MsgId) );
Before I do a put to queue B, I set the MsgId = save_msgid like this:
memcpy(md1.MsgId, save_msgid, sizeof(md1.MsgId) );
Then I do the MQPUT to queue B. The program runs OK, but it does not do what I expect. I expect the MQMD before each record in queue B to have the same MsgId value as its corresponding record in queue A. Instead, the records in queue B have their own unique MsgId values, just as if MQ is totally disregarding what I'm doing. Is there something else that I need to do to force MQ to use the MsgId that I'm specifying? Thank you for your help.
 
Never mind! I carelessly set the wrong MsgId. After I corrected that, it worked just like it should...thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top