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 » IBM MQ API Support » HOW to connect the Server using MSCONNX

Post new topic  Reply to topic
 HOW to connect the Server using MSCONNX « View previous topic :: View next topic » 
Author Message
ashutosh
PostPosted: Thu Mar 07, 2002 8:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolban
PostPosted: Thu Mar 07, 2002 9:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
ashutosh
PostPosted: Thu Mar 07, 2002 9:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
StefanSievert
PostPosted: Fri Mar 08, 2002 10:26 am    Post subject: Reply with quote

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
View user's profile Send private message
mrlinux
PostPosted: Fri Mar 08, 2002 11:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ashutosh
PostPosted: Sun Mar 10, 2002 8:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
ashutosh
PostPosted: Sun Mar 10, 2002 9:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
StefanSievert
PostPosted: Sun Mar 10, 2002 11:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
ashutosh
PostPosted: Mon Mar 11, 2002 1:07 am    Post subject: Reply with quote

Novice

Joined: 06 Mar 2002
Posts: 10

Thanks for the valuable inputs provided by StefanSievert.
Back to top
View user's profile Send private message
msantos007
PostPosted: Tue Jun 21, 2005 4:24 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » HOW to connect the Server using MSCONNX
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.