ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » Getting MsgID in perl

Post new topic  Reply to topic
 Getting MsgID in perl « View previous topic :: View next topic » 
Author Message
igals
PostPosted: Sun Oct 03, 2004 3:25 am    Post subject: Getting MsgID in perl Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Sun Oct 03, 2004 9:17 am    Post subject: Reply with quote

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
View user's profile Send private message
igals
PostPosted: Mon Oct 04, 2004 3:24 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Mon Oct 04, 2004 3:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Getting MsgID in perl
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.