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 » General IBM MQ Support » Using Perl to connect to clieny Queue Manager

Post new topic  Reply to topic
 Using Perl to connect to clieny Queue Manager « View previous topic :: View next topic » 
Author Message
drfunk2458
PostPosted: Wed Apr 04, 2007 7:21 am    Post subject: Using Perl to connect to clieny Queue Manager Reply with quote

Newbie

Joined: 04 Apr 2007
Posts: 4

I wrote this perl script that can connect to the local queue manager and do all sorts of fun stuff like: list queues, stop/start a channel, etc...

I would like to expand this to all my queue managers, but I keep getting reason code->2058 when I try to connect.

code snippet:
my $mqmgr =MQSeries::QueueManager->new (
QueueManager => "MBEVENTC",
ClientConn => { 'ChannelName' => "real_channel",
'TransportType'=> 'TCP',
"ConnectName'=> "hostname(6003)'
});

also tried:
$ConOpts = { 'ChannelName' => "real_channel",
'TransportType'=> 'TCP',
'ConnectName'=> "hostname(6003)"
};
$hconn = MQCONNX("MBEVENTC", {'ClientConn' => $ConOpts}, $cc, $reason);

neither seem to get me connected..
Does anyone have some examples on how this is accomplished?


Thanks,

M
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Wed Apr 04, 2007 7:43 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Don't specify the qmgr name.

Also, notice that you should be using "ConnectionName" and not "ConnectName".

http://search.cpan.org/~hbiersma/MQSeries-1.25/MQSeries/QueueManager.pm#SYNOPSIS
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
drfunk2458
PostPosted: Wed Apr 04, 2007 9:35 am    Post subject: re perl & MQSeries Reply with quote

Newbie

Joined: 04 Apr 2007
Posts: 4

Sorry my bad on the typo.

I do use ConnectionName

I removed the qmgr name but now I get a reason code = 2059
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Wed Apr 04, 2007 9:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Just to double-check, you did actually install the MQ Client on the machine?

And this machine also has MQ Server on it?

And you did "use MQClient::MQSeries" as the first MQSeries use in your code?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
drfunk2458
PostPosted: Wed Apr 04, 2007 10:41 am    Post subject: RE: MQSeries and Perl Reply with quote

Newbie

Joined: 04 Apr 2007
Posts: 4

Yes, the server and client bundles are installed.

I was able to successfully connect to a remote queue manager using the IBM sample amqsputc and setting the MQSERVER env variable.

Just can't seemed to make it work within the perl scripts

I tried putting use MQClient::MQSeries as the first use in my code,
but it didn't seem to work either..
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Wed Apr 04, 2007 10:44 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Can you try the same code on a machine that only has a client install?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
drfunk2458
PostPosted: Wed Apr 04, 2007 11:00 am    Post subject: RE: MQSeries and Perl Reply with quote

Newbie

Joined: 04 Apr 2007
Posts: 4

Ok it looks like putting the use MQClient::MQSeries first has some positive effects.

That seems odd to me? anyway I am now able to make a remote connections

Many Thanks.....

Why would moving it first make it work
Back to top
View user's profile Send private message MSN Messenger
jefflowrey
PostPosted: Wed Apr 04, 2007 11:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's the way it's documented to work, the MQClient::MQSeries is what binds against the client libraries.

Otherwise it binds against the server libraries.

This happens at compile time, not at runtime. So the order of the use statements is important.

It's possible, but very complicated and messy to defer this binding until runtime - not for the faint of heart.
_________________
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 » General IBM MQ Support » Using Perl to connect to clieny Queue Manager
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.