Hi
I'm having problems retreiving an MQ message from a queue by msg_ID. Here is the situation. I receive two messages from a main frame where the data is stored in EBCDIC. The first message stores the data queue name and the msg_id of the second message I'm suppose to pick up. I parse the first msg open up a second queue and attempt to grab the second message by msg id. Below is the code:
my $dqueue = MQSeries::Queue->new
(
QueueManager => $qmgr,
Queue => $arg{getQ},
Options => MQOO_INPUT_SHARED,
GetConvert => \&Convert::EBCDIC::ebcdic2ascii,
) or die("Unable to open data queue $DQueue.\n") ;
$getmessage = MQSeries::Message->new( MsgDesc => { MsgId => $MsgID,
Encoding => MQSeries::MQENC_NATIVE,
CodedCharSetID => MQSeries::MQCCSI_Q_MGR
format => MQSeries::MQFMT_STRING
}
) ;
$rslt = $dqueue->Get
(
Message => $getmessage ,
GetMsgOpts => { Options => MQSeries::MQGMO_ACCEPT_TRUNCATED_MSG |
MQSeries::MQGMO_FAIL_IF_QUIESCING,
MatchOptions => MQSeries::MQMO_MATCH_MSG_ID
}
) or die("Unable to get message\n" .
"CompCode = " . $dqueue->CompCode() . "\n" .
"Reason = " . $dqueue->Reason()." ".MQReasonToText($dqueue->Reason())."\n");
I'm hoping someone can spot what I'm doing wrong or point me in right direction on what to try next.
TIA
I'm having problems retreiving an MQ message from a queue by msg_ID. Here is the situation. I receive two messages from a main frame where the data is stored in EBCDIC. The first message stores the data queue name and the msg_id of the second message I'm suppose to pick up. I parse the first msg open up a second queue and attempt to grab the second message by msg id. Below is the code:
my $dqueue = MQSeries::Queue->new
(
QueueManager => $qmgr,
Queue => $arg{getQ},
Options => MQOO_INPUT_SHARED,
GetConvert => \&Convert::EBCDIC::ebcdic2ascii,
) or die("Unable to open data queue $DQueue.\n") ;
$getmessage = MQSeries::Message->new( MsgDesc => { MsgId => $MsgID,
Encoding => MQSeries::MQENC_NATIVE,
CodedCharSetID => MQSeries::MQCCSI_Q_MGR
format => MQSeries::MQFMT_STRING
}
) ;
$rslt = $dqueue->Get
(
Message => $getmessage ,
GetMsgOpts => { Options => MQSeries::MQGMO_ACCEPT_TRUNCATED_MSG |
MQSeries::MQGMO_FAIL_IF_QUIESCING,
MatchOptions => MQSeries::MQMO_MATCH_MSG_ID
}
) or die("Unable to get message\n" .
"CompCode = " . $dqueue->CompCode() . "\n" .
"Reason = " . $dqueue->Reason()." ".MQReasonToText($dqueue->Reason())."\n");
I'm hoping someone can spot what I'm doing wrong or point me in right direction on what to try next.
TIA