Author |
Message
|
drfunk2458 |
Posted: Wed Apr 04, 2007 7:21 am Post subject: Using Perl to connect to clieny Queue Manager |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Apr 04, 2007 7:43 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
drfunk2458 |
Posted: Wed Apr 04, 2007 9:35 am Post subject: re perl & MQSeries |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Apr 04, 2007 9:38 am Post subject: |
|
|
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 |
|
 |
drfunk2458 |
Posted: Wed Apr 04, 2007 10:41 am Post subject: RE: MQSeries and Perl |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Apr 04, 2007 10:44 am Post subject: |
|
|
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 |
|
 |
drfunk2458 |
Posted: Wed Apr 04, 2007 11:00 am Post subject: RE: MQSeries and Perl |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Apr 04, 2007 11:41 am Post subject: |
|
|
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 |
|
 |
|