Author |
Message
|
ashutosh |
Posted: Thu Mar 07, 2002 8:59 pm Post subject: |
|
|
Novice
Joined: 06 Mar 2002 Posts: 10
|
I am unable to connect to the Server from the client machine using MQCONNX.
Need some help about how to go about it, what all seetings needs to be done for the same?
What all values needs to be set for ths MQCNO,MQCD structure?
i am not using MESERVER variable, it gives me reason code as 2058,2059.
What all MQSeries Environment variables i need to set for the same?
I want to connect to multiple Server Channels simultaneously from mine client.
Urgent.
|
|
Back to top |
|
 |
kolban |
Posted: Thu Mar 07, 2002 9:14 pm Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
The easiest way to connect to multiple queue managers is to still use the MQCONN API call and have all the possible queue manager to which you wish to connect defined in an AMQCHLTAB file available to the client. If you really need to dynamically enter the location of the queue manager, which must include the SVRCONN channel name, protocol type and connection information then you will indeed have to use MQCONNX. See both the Application Programmers Guide and Application Programmers Reference for details on this API call and associated structures. |
|
Back to top |
|
 |
ashutosh |
Posted: Thu Mar 07, 2002 9:41 pm Post subject: |
|
|
Novice
Joined: 06 Mar 2002 Posts: 10
|
Mine Mqseries Configuration are as follows,
Server=Mqseries For Windows Ver 5.1 installed on Win NT m/c
Client=Meseries For Windows 95 installed on Win 98 m/c
I tried Dyanmic Connection using MQCONNX,the following steps were carried out.
1. Created a Server Connection Channel(on server).
2. Created a Client Connection Channel(on server).
3. Copied the Amqclchl.tab(for respective queue manager) files From Server to the Client m/c on the following location drive:mqclientqmgrsQueue Manager name @ipcc
4. Then SET MQCHLTAB,MQCHLLIB variables in the autoexec.bat.
5. Then from VB Application the following code is written
MQCNO_DEFAULTS Cno
MQCD_DEFAULTS cd
cd.ChannelType = MQCHT_CLNTCONN
cd.TransportType = MQXPT_TCP
cd.ChannelName = "Channel2"
cd.ConnectionName = "172.24.2.122(1416)"
' Connect to the Queue Manager specified in the text field
MQCONNX QMgrName, Cno, gHcon, CompCode, Reason
on running the application it returns a reason code 2058.
Are we setting the parameters properly, if NO then How the Parameters(such as ClientConnOffset,ClientConnPtr, etc.) are to be set?
|
|
Back to top |
|
 |
StefanSievert |
Posted: Fri Mar 08, 2002 10:26 am Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Hi,
what is your development environment, i.e. what language do you program in?
If you use AMQCLCHL.TAB, there is no real need to use MQCONNX, because the necessary information is in the channel file and it gets selected using the queue manager name specified on the MQCONN call.
A 2058 always 'smells' like you are trying to run an application linked with the server library (mqm.lib) on a client. Can you verify that your application is linked using the correct library for your environment?
HTH,
Stefan
_________________ Stefan Sievert
IBM Certified * WebSphere MQ |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Mar 08, 2002 11:20 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
What is the variable QMgrName contain, The 2058 is more of a mismatch between
the qmanager name specified in your program and the queue manager you are trying to attach too.
_________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
ashutosh |
Posted: Sun Mar 10, 2002 8:21 pm Post subject: |
|
|
Novice
Joined: 06 Mar 2002 Posts: 10
|
Mine Development Environment is VB 6.0 and I want to have a dyamic connecion between Client and server i.e i want to connect to multiple Queue Manager simultaneouly at runtime without using MQSERVER Varaible.
DO you have any sample VB code using the MQCONNX Function?
i am geting Compcode=2 & reason=5058,5059 |
|
Back to top |
|
 |
ashutosh |
Posted: Sun Mar 10, 2002 9:01 pm Post subject: |
|
|
Novice
Joined: 06 Mar 2002 Posts: 10
|
For Each queue manager on the server there is a Amqclchl.tab file and Amqrfcda file which stores queue manager specific information.
If these files are copied on the client machine then it connects to the single queue manager at any given point of time.
This places a limitation on the connectivity to the queue manager i.e each time the Amqclchl.tab file and Amqrfcda needs to be replaced for conneciting to that particular queue manager.
Is there any way of Connecting to a queue manager of choice without need to copy Amqclchl.tab file and Amqrfcda files everytime for a individual queue manager? |
|
Back to top |
|
 |
StefanSievert |
Posted: Sun Mar 10, 2002 11:51 pm Post subject: |
|
|
 Partisan
Joined: 28 Oct 2001 Posts: 333 Location: San Francisco
|
Here's what you have to do:
Pick one queue manager of your choice (you can also create a 'dummy' queue manager for that) and define all server connection channels you need to connect to the selected and your other queue managers. This will create an AMQCLCHL.TAB file in the @IPCC subdirectory of the queue manager you used that contains all channel definitions to all other queue managers. Copy this file to your client machine(s) and you will be able to connect to all queue managers for which there is a channel definition in this file using the standard MQCONN call.
Example:
First of all create a text file, let's name it mqsc.inp, containing the channel definitions for all queue managers, for example:
DEFINE CHANNEL(CLIENT) CHLTYPE(CLNTCONN) TRPTYPE(TCP) +
CONNAME(1.2.3.4) QMNAME(QM1) DESCR('Client-connection to Server_1')
DEFINE CHANNEL(CLIENT) CHLTYPE(CLNTCONN) TRPTYPE(TCP) +
CONNAME(5.6.7. QMNAME(QM2) DESCR('Client-connection to Server_2')
DEFINE CHANNEL(CLIENT) CHLTYPE(CLNTCONN) TRPTYPE(TCP) +
CONNAME(9.10.11.12) QMNAME(QM3) DESCR('Client-connection to Server_3')
Then
1) crtmqm DUMMYQM
2) strmqm DUMMYQM
3) runmqsc DUMMYQM < mqsc.inp
4) copy ../MQSeries/qmgrs/DUMMYQM/@IPCC/AMQCLCHL.TAB to your client machine
5) SET MQCHLLIB/MQCHLTAB appropriately
6) use MQCONN call with QM1, QM2 or QM3 to connect to your target queue manager of choice (or to multiple queue managers)
The appropriate channel definition gets selected from the channel file using the queue manager name as the key. The first entry that matches the queue manager name, gets selected. If the connection fails, the MQ client code (not your application code) picks the next definition and tries to connect. This process continues until there is a successful connection or no more entries for the given queue manager name. If you would have defined two entries, let's say for QM2, using different IP addresses or a different network protocol, you could implement some failover logic this way.
Let us know, if you have any more questions.
Hope that helps,
Stefan
BTW: You shouldn't worry about the Amqrfcda file you were referring to. It is used by the queue manager and opaque to you.
[ This Message was edited by: StefanSievert on 2002-03-11 00:16 ] |
|
Back to top |
|
 |
ashutosh |
Posted: Mon Mar 11, 2002 1:07 am Post subject: |
|
|
Novice
Joined: 06 Mar 2002 Posts: 10
|
Thanks for the valuable inputs provided by StefanSievert. |
|
Back to top |
|
 |
msantos007 |
Posted: Tue Jun 21, 2005 4:24 am Post subject: |
|
|
Voyager
Joined: 20 Dec 2004 Posts: 78
|
you are not supposed to include mqm.lib
the right library is mqic32.lib _________________ Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer |
|
Back to top |
|
 |
|