|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
[Solved] MQ MessageID with Perl |
« View previous topic :: View next topic » |
Author |
Message
|
mqjay |
Posted: Fri Aug 06, 2004 7:05 am Post subject: [Solved] MQ MessageID with Perl |
|
|
Newbie
Joined: 06 Aug 2004 Posts: 4
|
I'm doing an MQPUT in Perl. I'm using the messageID from the PUT to use as the CorrelID on the subsequent GET. The problem is that the messageID always appears to be the same. Do I need to generate that myself, or do I need to set something differently so that it happens automatically? -- Any help would be appreciated.
$::putq = MQSeries::Queue->new
(
QueueManager => $::qmgr,
Queue => $::putqname,
Options => MQSeries::MQOO_FAIL_IF_QUIESCING |
MQSeries::MQOO_OUTPUT |
MQSeries::MQOO_SET_IDENTITY_CONTEXT,
) || die "Unable to open $::putqname\n";
print "Put queue $::putqname is opened\n";
&logger::write_to_log( "Put queue $::putqname is opened\n") ;
# Put the message
MQSeries::Message::IIH->_setEndianess(1);
$::putmessage = MQSeries::Message::IIH->
new(Header => { ReplyToFormat => 'MQIMSVS',
CommitMode => MQSeries::MQICM_COMMIT_THEN_SEND,
TransState => MQSeries::MQITS_IN_CONVERSATION,
},
Data => { Transaction => $::inputtrans,
Body => $::inputmessage,
},
MsgDesc => { Format => MQSeries::MQFMT_IMS,
UserIdentifier => $::userid,
Expiry => $::expiry,
ReplyToQ => $::getqname,
MessageType => MQSeries::MQMT_REQUEST,
},
);
$::putq->Put
(
PutMsgOpts => { Options => MQSeries::MQPMO_SET_IDENTITY_CONTEXT | MQSe
ries::MQPMO_FAIL_IF_QUIESCING,
},
Message => $::putmessage,
) || die "Unable to put reply message\n";
print "Message $::putmessage has been placed on queue\n";
print "Message id is: " . $::putmessage->MsgDesc->{MsgId} . "\n";
&logger::write_to_log("Message id is: " . $::putmessage->MsgDesc->{MsgId} ); |
|
Back to top |
|
 |
vennela |
Posted: Fri Aug 06, 2004 8:43 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
I think in your putMessageOptions you need MQPMO_NEW_MSG_ID |
|
Back to top |
|
 |
mqjay |
Posted: Mon Aug 16, 2004 10:00 am Post subject: |
|
|
Newbie
Joined: 06 Aug 2004 Posts: 4
|
Thanks! It's working great now. |
|
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
|
|
|
|