Author |
Message
|
bhandar_amit |
Posted: Mon Jul 30, 2007 11:21 pm Post subject: Configuring MQ client to connect to local queue manager |
|
|
Novice
Joined: 30 Jul 2007 Posts: 15
|
hi all,
i am using IBM MQ v6.0 and its C APIs. i am building a application with client libraries (i.e. libmqic.so) and using MQSERVER env variable to connect to remote queue manager. That is working fine.
But how do i allow the application to connect to local queue manager?
What configuration do i need for that?
Any help regarding this will be great. Thanks in advance.
Regards,
Amit Bhandar
Last edited by bhandar_amit on Tue Jul 31, 2007 5:25 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 30, 2007 11:37 pm Post subject: Re: Configuring MQ client to connect to local queue manager |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bhandar_amit wrote: |
But how do i allow the application to connect to local queue manager?
What configuration do i need for that?
|
1) Be aware that it's perfectly valid to establish a client connection to a local queue manager i.e. one running on the same box as your application.
2) If you decide (again for perfectly valid reasons) you want to establish a bindings connection to a local queue manager rather than a client one then your application needs to be linked with the server side libraries rather the client ones you're currently using. You'll find details of this in the Application Programming guide. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bhandar_amit |
Posted: Tue Jul 31, 2007 12:37 am Post subject: Re: Configuring MQ client to connect to local queue manager |
|
|
Novice
Joined: 30 Jul 2007 Posts: 15
|
hi vitor,
thanks for the reply.
if i have a application whose one instance want to connect to local queue manager (on the same box) and some other instance wants to connect to remote queue manager, then how do i do that?
can i do that using the server side libraries? or i need to have two different applications (one using the client libraries and other server libraries)? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 31, 2007 12:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
In that instance it's considered best practice to link the application with the client side libraries and allow it to connect to whatever queue manager it wants (see my point 1 above).
You could link 2 versions, one client, one server but what would be the point? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bhandar_amit |
Posted: Tue Jul 31, 2007 12:58 am Post subject: |
|
|
Novice
Joined: 30 Jul 2007 Posts: 15
|
[quote="Vitor"]In that instance it's considered best practice to link the application with the client side libraries and allow it to connect to whatever queue manager it wants (see my point 1 above).
You could link 2 versions, one client, one server but what would be the point?[/quote]
Yes, i am linking my application with client side libraries, then the application is able to connect to the remote queue manager as i am giving the details in MQSERVER env variable. But the same application is not connecting to a local queue manager. Its giving 2059,MQRC_Q_MGR_NOT_AVAILABLE error.
i am giving the IP of local machine in MQSERVER when trying to connect to local queue manager.
Can you please tell me is there anything else needs to be done?
Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 31, 2007 1:04 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bhandar_amit wrote: |
Its giving 2059,MQRC_Q_MGR_NOT_AVAILABLE error. |
Use the search button to find posts for 2059 - it's the most common problem in client connections and in a majority of cases has nothing to do with the application or the MQ configuration per se.
All it means is that a client connection can't be established with the local queue manager. Typcially there's a firewall or other impediment, but your search will give you a "laundry list" of things to check.
You might also want to specify the port of the queue manager in the MQSERVER, especially if it's not using the default one!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bhandar_amit |
Posted: Tue Jul 31, 2007 2:05 am Post subject: |
|
|
Novice
Joined: 30 Jul 2007 Posts: 15
|
i searched for the error in the qmgr directory and i found this -
AMQ9503: Channel negotiation failed.
EXPLANATION:
Channel 'SYSTEM.DEF.SVRCONN' between this machine and the remote machine could
not be established due to a negotiation failure.
Here the remote machine is nothing but the local machine.
And i have set the SYSTEM.DEF.CLNTCONN with the IP address and QMNAME.
Can you help me with this? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 31, 2007 2:16 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You've got a configuration error. Check out the Clients manual for detailed information but you need to either use MQSERVER & a server connection channel or use a client connection table & a client connection channel. Not both as you seem to be doing.
I'd recommend you speak to whoever administers the queue manager(s) you're using and get them to generate a client connection table containing names & details of all the queue managers your application needs to reference. This will be far easier than trying to set MQSERVER each time you run the application against a different queue manager. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bhandar_amit |
Posted: Tue Jul 31, 2007 3:43 am Post subject: |
|
|
Novice
Joined: 30 Jul 2007 Posts: 15
|
As per my requirement setting MQSERVER is better.
So I am using a default server conn channel SYSTEM.DEF.SVRCONN.
And setting MQSERVER to
MQSERVER=SYSTEM.DEF.SVRCONN/TCP/localhost(1414)
But i am still getting this error -
AMQ9503: Channel negotiation failed.
Any help?
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 31, 2007 3:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Do you get a Return Code from your MQCONN? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bhandar_amit |
Posted: Tue Jul 31, 2007 3:56 am Post subject: |
|
|
Novice
Joined: 30 Jul 2007 Posts: 15
|
the return code i am getting-
MQCONN call failed with reason code 2059 and text MQRC_Q_MGR_NOT_AVAILABLE |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 31, 2007 3:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
Do you get a Return Code from your MQCONN? |
Presumably the 2059 mentioned earlier.
But if it's not that could be a clue.
I hate it when assumptions sneak up on me. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 31, 2007 3:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bhandar_amit wrote: |
As per my requirement setting MQSERVER is better. |
Why? Using a client table would allow it to be packed with the application and the relevant queue manager fed to the application directly.
What is your driving requirement here? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 31, 2007 4:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, so you're sure you've linked your code against mqic32, and you're using MQServer.
And you're getting a channel negotiation error in the AMQERR log, or in the Event Viewer at the same time.
what does amqscnxc do with the same information (same MQSERVER)? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bhandar_amit |
Posted: Tue Jul 31, 2007 4:14 am Post subject: |
|
|
Novice
Joined: 30 Jul 2007 Posts: 15
|
hi vitor,
actually i have a application which is built with client side libraries.
this appln should connect to a single QM at a time and that QMcan be either remote/local. it has a configuration parameter PROCESS_ENVIRONMENT where i can specify MQSERVER for that particular instance of the appln. So one instance can connect to local and other can connect to remote QM.
Now that after mentioning MQSERVER with the correct IP of remote server,i am able to connect to remote QM. but that is not happening for local QM.
i am using the default server channel on the local QM (which is not the default QM).
And i am getting the errors mentioned above in the process.
Thanks,
Amit |
|
Back to top |
|
 |
|