Connecting to a queue manager, using the MQSERVER environment variable on Windows
When an IBM MQ application is run on the IBM MQ MQI client, it requires the name of the MQI channel, the communication type, and the address of the server to be used. Provide these parameters by defining the MQSERVER environment variable.
Before you begin
Before you start this task, you must complete the task, Set up the server using the command line on Windows, and save the following information:- The host name or IP address of the server and port number that you specified when creating the listener.
- The channel name of the server-connection channel.
This task describes how to connect an IBM MQ MQI client, by defining the MQSERVER environment variable on the client.
We can give the client access to the generated client channel definition table, amqclchl.tab instead; see Accessing client-connection channel definitions.
Alternatively, on Windows, if Active Directory support is enabled, the client discovers the client-connection information dynamically from the Active Directory.
Procedure
- Log in as the userid that you created in Step 1 of Set up the server using the command line on Windows.
-
Check the TCP/IP connection. From the client, enter one of the following commands:
- ping server-hostname
-
ping n.n.n.n
n.n.n.n represents the network address. We can set the network address in IPv4 dotted decimal form, for example, 192.0.2.0. Alternatively, set the address in IPv6 hexadecimal form, for example 2001:0DB8:0204:acff:fe97:2c34:fde0:3485.
-
Set the MQSERVER environment variable. From the client, enter the following
command:
SET MQSERVER=CHANNEL1/TCP/server-address (port)
Where:- CHANNEL1 is the server-connection channel name.
- server-address is the TCP/IP host name of the server.
- port is the TCP/IP port number the server is listening on.