|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Getting MsgID in perl |
« View previous topic :: View next topic » |
Author |
Message
|
igals |
Posted: Sun Oct 03, 2004 3:25 am Post subject: Getting MsgID in perl |
|
|
Newbie
Joined: 05 Jan 2004 Posts: 2
|
Hello professionals.
Need help on my prog, trying to print the MsgId for debugging purpose
and after printing i see some garbage and same MsgId. May be anyone
can help by looking on my code
use strict;
use MQSeries;
use Benchmark;
my $expiry = 10000;
my $qmgrname = 'QM_4_Perl';
my $requestqname = 'PERL.EXAMPLES.RR1.REQUEST';
my $replyqname = 'PERL.EXAMPLES.RR1.REPLY';
my ($CompCode,$Reason,$COptions);
my $bufferlen=32000;
# start timer
my $start = new Benchmark;
#
# Step 1: connect to the queuemanager.
#
my $Hconn = MQCONN($qmgrname, $CompCode, $Reason);
#
# Step 2: Open Put queue
#
my $Correl_Id;
my $POptions = MQOO_OUTPUT | MQOO_FAIL_IF_QUIESCING;
my $PObjDesc = { ObjectName => $requestqname };
my $PHobj = MQOPEN($Hconn,$PObjDesc,$POptions,$CompCode,$Reason);
#Set MQMD
my $PMsgDesc = { CorrelId => MQPMO_NEW_CORREL_ID,
MsgId => MQPMO_NEW_MSG_ID,
Format=> MQFMT_STRING,
MessageType => MQMT_REQUEST };
my $PutMsgOpts = { Options=> MQPMO_FAIL_IF_QUIESCING | MQPMO_NEW_MSG_ID |
MQPMO_NEW_CORREL_ID ,
};
my $Buff;
#
# Step 3: Open Get queue
#
my $GOptions = MQOO_INPUT_AS_Q_DEF | MQOO_FAIL_IF_QUIESCING;
my $GObjDesc = { ObjectName => $replyqname};
#Set MQMD
my $GMsgDesc = { CorrelId => $Correl_Id,
MsgId => MQSeries::MQMI_NONE };
my $GetMsgOpts = { Options => MQGMO_FAIL_IF_QUIESCING |
MQGMO_WAIT, WaitInterval => 600000,
MatchOptions => MQSeries::MQMO_MATCH_CORREL_ID };
my $GHobj = MQOPEN($Hconn,$GObjDesc,$GOptions,$CompCode,$Reason);
print"OPEN: $Reason\n";
#
# Step 4: Put message on request queue
#
$Buff = "The Message";
MQPUT($Hconn, $PHobj, $PMsgDesc, $PutMsgOpts, $Buff, $CompCode, $Reason);
print"Put reason: $Reason\n";
print "Put msgid is from MQMD $PMsgDesc->{MsgId}\n";
print "Put msgid is from Options $PutMsgOpts->{MsgId}\n"; _________________ Igal |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Oct 03, 2004 9:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Message IDs are binary data.
Binary data can contain non-printable characters.
If you have two message IDs that differ only by which non-printable character they have in the first byte, then they will look the same when you print them - since the only difference is not printable. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
igals |
Posted: Mon Oct 04, 2004 3:24 am Post subject: |
|
|
Newbie
Joined: 05 Jan 2004 Posts: 2
|
To jefflowrey, Thnanx. U was right, I added Get with CorrelId and it's work fine. _________________ Igal |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Oct 04, 2004 3:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
igals wrote: |
To jefflowrey, Thnanx. U was right, I added Get with CorrelId and it's work fine. |
Correlation IDs are also binary data... _________________ I am *not* the model of the modern major general. |
|
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
|
|
|
|