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.
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.