Hi Team,
Many Thanks for your reply.I am new to perl and mqseries.i am facing so many problem to connect to my local mqseries queue.
Sorry for such a big below mail.I am writing this mail,as you can understand my problem clearly ,which would help me to resolve the issue.
Step-1-Following is my Environment details
SunOS 5.10 Generic_144488-09 sun4v sparc SUNW,SPARC-Enterprise-T5220
MQseries version-6.0
Perl 5.8
Step-2-
I have first used the object oriented approach.When i used that approach and wrote the script like below,i have got the below error.which i have specified below.
Code:
-Mandatory parameter 'AutoConnect' missing in call to MQSeries::QueueManager::Connect
MQSeries::QueueManager::Connect('MQSeries::QueueManager=HASH(0x7ae7ec)') called at Mqutils.pm line 63
Mqutils::openQueueMgr('Mqutils=HASH(0x32590)', 'QM.A108020', 10.225.98.86, 1414, 'QM.A108020', 'request') called at ./mq_put.pl line 25
-------------------------------------------------------------------------------------
Following is the snap shot of my perl script code.if you look the below code, the argument AutoConnect is already present inside Queuemanager::new in the last row.
Inspite of that when i am using the object,which is create by Quemanger constructer to call connect() api,it is giving the error,which i have specified above.
Code:
my $qm = MQSeries::QueueManager->new(
QueueManager => $qm_name,
Carp => 0,
CompCode => 0,
Reason => 0,
GetConvert => 0,
PutConvert => 0,
RetryCount => 0,
RetrySleep => 0,
RetryReasons => 0,
ConnectTimeout => 0,
ConnectTimeoutSignal => 0,
ClientConn => 0,
SSLConfig => 0,
AutoConnect => 0,
AutoCommit => 0,
)|| die "Unable to instantiate MQSeries::QueueManager object\n";
print "After new and before connect\n";
# kick it off and see if it connects
# eval {
$qm->Connect()
|| die(sprintf("Connect failed with CompCode: %s",
"Reason %sn",$qm->CompCode(),$qm->Reason()));
# };
Step-3-
When i didnt suceed to resolve the above problem,I thought to use the MQAPI directly in my call,in the following way,which i am specifying below.
When i am using the below script,i am getting the junk comp code and reson code and it is not either connecting to queue manager or sending message to queue.
So could you please help me how to resolve this problem,if it is a data conversion problem or anything wrong in my perl script.
Code:
#!/usr/bin/perl -w
package Mqutils;
my $VERSION = '1.0';
use Carp;
use English;
use strict;
use MQSeries qw(:functions);
use MQSeries qw(:constants);
use MQServer::MQSeries;
use MQSeries::QueueManager;
use MQSeries::Queue;
use MQSeries::Message;
use MQSeries::Message::Storable;
my $Hconn = "";
my $Hobj = 0;
my $MsgDesc = undef;
my $datalength = undef;
sub new() { # our constructor
my $invocant = shift;
my $class = ref($invocant) || $invocant; # Object or class name
my $self = {}; # initiate our handy hashref
bless($self,$class); # make it usable
return $self;
}
sub openQueueMgr() { # open the Queue Manager
my $self = shift;
my $compCode = 0;
my $Reason = 0;
print "Inside openqueuemgr \n";
my ($qm_name) = @_;
print "Queue Manager is $qm_name \n";
print "Santosh Inside connect\n";
$compCode = MQSeries::MQCC_FAILED;
$Reason = MQSeries::MQRC_UNEXPECTED_ERROR;
my $mnone = MQSeries::MQRC_NONE;
print "-------------------------------------------\n";
print "mqnone is $mnone\n";
print "code is $compCode\n";
print "Reason is $Reason\n";
print "Before calling MQCONN\n";
print "-------------------------------------------\n";
$Hconn = MQCONN($qm_name,
$compCode,
$Reason,
)|| die "Unable to Connect to Queuemanager\n";
if ( ($compCode) == MQSeries::MQCC_FAILED ) {
print "Connection to Queuemanager failed\n";
#return 1;
} elsif ( $compCode == MQSeries::MQCC_WARNING ) {
print "Connected the Queue Mager with Warning\n";
} elsif ( $compCode == MQSeries::MQCC_OK ) {
print "Connection sucessful with the queue manager\n";
}
else {
print "complition code is $compCode\n";
}
if ( $Reason == MQSeries::MQRC_NONE ) {
print "Connection to Queuemanager Fine\n";
#return 1;
} elsif ( $Reason == MQSeries::MQCC_WARNING ) {
print "Connected the Queue Mager with Warning\n";
# return -1;
} elsif ( $Reason == MQSeries::MQRC_UNEXPECTED_ERROR) {
print "Unexpected error while connect to the queue manager\n";
} elsif ( $self->{"Reason"} == MQSeries::MQRC_ENVIRONMENT_ERROR ) {
print "environment error in Queue Mager\n";
# return -1;
} elsif ( $self->{"Reason"} == MQSeries::MQRC_MULTIPLE_REASONS) {
print "hconn errorr\n";
} elsif ( $self->{"Reason"} == MQSeries::MQRC_NOT_AUTHORIZED) {
print "not authorize errorr\n";
} elsif ( $self->{"Reason"} == MQSeries::MQRC_Q_MGR_NAME_ERROR) {
print "Queue Manager errorr\n";
}
else {
print "Reason is $Reason\n";
print "\n";
}
print "After MQCONN\n";
}
Step-4-if you look above code,even the control is not comming to any of the resoncode and compcode,which i have specified in the above if else condition.
Please help me in this above issue.
Thanks,
Santosh
________________________________________
From: perl-mqser...@morganstanley.com [perl-mqser...@morganstanley.com]
Sent: Wednesday, February 22, 2012 6:51 PM
To: Santosh Sadangi
Cc: modules@perl.org
Subject: Re: CPAN Mqseries Module for Solaris5.10
On Wed, Feb 22, 2012 at 11:59:55AM +0530, Santosh Sadangi wrote:
> Hi Team,
>
> I am new to perl and Cpan Mqseries.I have written one script to connect to
> local queuemanager by using perl.However it is not connecting to my
> Queuemanager and the error code and completion code which i am getting is a
> junk value.
>
> Upon investigation i have found from the following cpanmqseries web link
> that,MQSeries1.32 is not supporting Solaris5.10 64bit platfoem.
>
> http://search.cpan.org/~mqseries/MQSeries-1.32/README
>
> So could you please let me know?which version of CPANMqseries is supporting for
> Solaris5.10 64bit platform.
they should all work on that platform, but you're not giving us much
to go on here. what completion and reason codes are you getting? can
you produce a small code sample that replicates the problem?
|