Author |
Message
|
pappus |
Posted: Wed Sep 05, 2001 12:19 pm Post subject: |
|
|
Newbie
Joined: 21 Aug 2001 Posts: 5
|
Is there anyone out there in the world that has connected to MQ using the MQCONNX call from perl. If so, please send me the code snippet. I posted this message 10 days ago and got no resposnse so far.
Thank You. |
|
Back to top |
|
 |
bduncan |
Posted: Wed Sep 05, 2001 4:16 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Pappus,
Sorry I didn't respond to your first message. Going back, I noticed that it was posted within the flow of another discussion on Perl. This is probably why I missed it, so it's good that you reposted it as a new thread. Anyhow, I've had extensive experience with Perl and MQ, and while I have used MQCONNX in the past, I don't think I have any sample code handy that uses it.
My question to you is, what difficulties are you running into? Are you using it and getting MQSeries errors, or are you just trying to figure out how to implement it? I ask, because normally you don't need to use MQCONNX. The only thing it provides above the regular MQCONN is the ability to specify connect options. It's typically used to specify the type of bindings to use. So maybe you could give a little more detail on how you are trying to use MQCONNX?
thanks...
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
pappus |
Posted: Thu Sep 06, 2001 5:32 am Post subject: |
|
|
Newbie
Joined: 21 Aug 2001 Posts: 5
|
In my application I have a broker written in Java listening for messages from clients. When it receives a message, it puts it on a Process queue and then executes a Perl program,(all our server code is written in perl) on a separate thread and passes it the messageId/correlId to process. The problem is, when it executes the perl code, it does not see the MQSERVER environment variable. To get around the problem, I am creating a batch file from java with "set MQSERVER" command followed by the perl script call. I do not like this solution because it is not a platform independent. I prefer to use MQCONNX all the time. I would appreciate it, if you could post some sample code.
Thanks. |
|
Back to top |
|
 |
bduncan |
Posted: Thu Sep 06, 2001 9:13 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Another question: Are you running a single queue manager on the server? If so, and if it's the default queue manager, you can simply use MQCONN and specify the queue manager name as "" (blank) and your process will connect to the default queue manager. Otherwise, why not pass the queue manager name as a parameter to the perl program just like you are already passing the msgid and correlid?
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
pappus |
Posted: Thu Sep 06, 2001 9:30 am Post subject: |
|
|
Newbie
Joined: 21 Aug 2001 Posts: 5
|
Its not a question of passing or not passing a QManager name. Actually I am passing the QManager name and Queue name too. But, more important than that, the perl code needs to know the channel/host/port. That's where I am having trouble. We have multiple queue managers running on different machines to serve as dev/qa/prod environments and that's the reason I cannot rely on MQSERVER environment variable. I have to use MQCONNX call.. |
|
Back to top |
|
 |
bduncan |
Posted: Thu Sep 06, 2001 12:16 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
I'm still not clear as to whether you have tried to implement MQCONNX and you are having problems, or you are just looking for an example of how to do it? If I'm not mistaken the CPAN MQ perl module comes with some HTML documents showing how to use the various calls...
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
pappus |
Posted: Fri Sep 07, 2001 4:42 am Post subject: |
|
|
Newbie
Joined: 21 Aug 2001 Posts: 5
|
Yes. I have tried using MQCONNX lot of different ways without success. Following is one of the ways that I tried:
--------------------------------------------
$QMGR = "QM.TOR.1" ;
$Connection =
{ ConnectionName => "mqhost00009(1415)",
ChannelName => "S.QM.TOR.1"
};
$Coption =
{
ClientConnPtr => $Connection,
Version => MQCNO_VERSION_2
};
$Hconn = MQCONNX($QMGR, $Coption, $CompCode, $Reason);
--------------------------------------------
and NO, the CPAN perl module documentation does not give any usefull examples. |
|
Back to top |
|
 |
bduncan |
Posted: Fri Sep 07, 2001 11:28 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
pappus,
So does the code snippet you provided actually compile? Is perl complaining about syntax errors, or does the compilation work, but it isn't behaving as you expect? If there are any associated MQSeries reason codes that would be very helpful. One thing I did stumble upon, is that the MQSeries documentation states:
"If the application is not running as an MQ client, ClientConnOffset and ClientConnPtr are ignored"
That might be your problem if you are connecting to a server...
_________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
|