Author |
Message
|
Sam12345 |
Posted: Thu Oct 02, 2003 6:39 am Post subject: I'm doing something wrong with the CorrelId... |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
I'm doing something wrong with the CorrelId. If someone could please look at the snippet below and tell me where I've gone wrong... The print statements show I have the MsgId and the ReplyToQ correctly loaded, but the CorrelId is always blank....
It is written in Perl. Any help greatly appreciated.
my $CIRCorrelId = " MSS0001";
my $CIRReplyToQ = "MQST.TALK.OUTPUT";
my $MsgDesc =
{ReplyToQ => $CIRReplyToQ,
Format => MQFMT_STRING,
MsgId => $CIRCorrelId,
MQMD_REPORT => MQRO_COPY_MSG_ID_TO_CORREL_ID |MQRO_PASS_CORREL_ID | MQRO_PASS_MSG_ID};
my $PutMsgOpts = {MQRO_COPY_MSG_ID_TO_CORREL_ID};
MQPUT($Hconn,
$Hobj_send,
$MsgDesc,
$PutMsgOpts,
$test_msg1,
$CompCode,
$Reason);
print"MQPUT 1 reason:$Reason\n";
print"********************************************\n";
print " Correlid:" . $MsgDesc->{CorrelId} . "\n";
print " MsgId:" . $MsgDesc->{MsgId} . "\n";
print " ReplyToQ:" . $MsgDesc->{ReplyToQ} . "\n";
print " Hobj_send:" . $Hobj_send . "\n";
print " MsgDesc:" . $MsgDesc . "\n";
print "PutMsgOpts:" . $PutMsgOpts . "\n";
print"********************************************\n"; |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Oct 02, 2003 7:00 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
I dont see where you set the correlID field in the mqmd(MsgDesc) in your code ??
I will look closer to make sure I didnt miss something _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
Sam12345 |
Posted: Thu Oct 02, 2003 7:07 am Post subject: I'm doing something wrong with the CorrelId |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
Jeff,
If I do the following, it does appear:
my $MsgDesc =
{ReplyToQ => $CIRReplyToQ,
Format => MQFMT_STRING,
MsgId => $CIRCorrelId,
CorrelId => $CIRCorrelId,
MQMD_REPORT => MQRO_COPY_MSG_ID_TO_CORREL_ID |MQRO_PASS_CORREL_ID | MQRO_PASS_MSG_ID};
But I was told locally I did not have to do this because it should get transferred from the MsgId automatically. I'm I getting bad advice and the code above is correct? |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Oct 02, 2003 7:29 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
I believe you are getting bad advice, or who gave you the advice means somewhere after your MQPUT call the correlID is copied from the msgid, for instance if you are using MQSI Broker the message flow inside the broker can do the copying. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Oct 02, 2003 8:14 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
If you are counting on the flags to do the copying, they are supposed to be honored by the program getting the message. There are a couple of C samples at: http://www.developer.ibm.com/tech/sampmq.html. They are called mqsrvro.cpp and mqreqro.cpp that show the processing that the getter does. |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Oct 02, 2003 8:28 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Looking at his perl script and his description he was expecting it to happen
based on the MQPUT call only. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
Sam12345 |
Posted: Thu Oct 02, 2003 9:57 am Post subject: I'm doing something wrong with the CorrelId... |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
Then, assuming no additional packages such as the MQSI Broker, is the last piece of code where I manually load the CorrelId to both the MsgId and the CorrelId the correct way to do this? |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Oct 02, 2003 10:07 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Yes, however I have to ask a question do you plan on using the correlID to retrieve a reply to your message or are you just setting it to set it because someone told you had to set it ???? _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
Sam12345 |
Posted: Thu Oct 02, 2003 10:21 am Post subject: I'm doing something wrong with the CorrelId... |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
Yes to both. I was told I need to set it so I can retrive a response on the ReplyToQ from a mainframe. I was given a specific CorrelId to use. |
|
Back to top |
|
 |
mrlinux |
Posted: Thu Oct 02, 2003 10:39 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
Well then you are doing it correctly. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
Sam12345 |
Posted: Thu Oct 02, 2003 10:45 am Post subject: |
|
|
Novice
Joined: 11 Sep 2003 Posts: 15
|
|
Back to top |
|
 |
|