channel definition, using, MQSERVER, simple client-connection channel definition, introduction, MQCNO structure, defining a client-connection channel, MQCONNX call, MQCD structure, MQSCO structure" />
Home
On the WebSphere MQ client
There are two ways of defining a client-connection channel on the client machine.
Using MQSERVER
We can use the MQSERVER environment variable to specify a simple definition of a client-connection channel. It is simple in the sense that we can specify only a few attributes of the channel using this method.
- Specify a simple channel definition on Windows as follows:
SET MQSERVER=ChannelName/TransportType/ConnectionName- Specify a simple channel definition on UNIX systems as follows:
export MQSERVER=ChannelName/TransportType/ConnectionName
Where:
ChannelName must be the same name as defined on the server. It cannot contain a forward slash.
TransportType can be one of the following, depending on your WebSphere MQ client platform:
Note:On UNIX systems the TransportType is case sensitive and must be uppercase. An MQCONN or MQCONNX call will return 2058 if the TransportType is not recognizedConnectionName is the name of the server machine as defined to the communications protocol (TransportType).
For example, on Windows:
SET MQSERVER=CHAN1/TCP/MCID66499or, on a UNIX system:
export MQSERVER=CHAN1/TCP/'MCID66499'Note:To change the TCP/IP port number, see MQSERVER.Figure 6. Simple channel definitionSome more examples of a simple channel definition on Windows are:
SET MQSERVER=CHAN1/TCP/9.20.4.56 SET MQSERVER=CHAN1/NETBIOS/BOX643Some examples of a simple channel definition on a UNIX system are:
export MQSERVER=CHAN1/TCP/'9.20.4.56' export MQSERVER=CHAN1/LU62/BOX99Where
BOX99 is the LU 6.2 ConnectionName.
On the WebSphere MQ client, all MQCONN or MQCONNX requests then attempt to use the channel you have defined, unless the channel is overridden in an MQCD structure referenced from the MQCNO structure supplied to MQCONNX.
Note:For more information on the MQSERVER environment variable see Using WebSphere MQ environment variables.
Using the MQCNO structure on an MQCONNX call
A WebSphere MQ client application can use the connect options structure, MQCNO, on an MQCONNX call to reference a channel definition structure, MQCD, that contains the definition of a client-connection channel.
In this way, the client application can specify the ChannelName, TransportType, and ConnectionName attributes of a channel at run time, and this enables the client application to connect to multiple server queue managers simultaneously. This is not possible if you define a channel using the MQSERVER environment variable.
A client application can also specify attributes of a channel such as MaxMsgLength and SecurityExit. This allows the client application to specify values for the attributes that are not the default values, and allows channel exit programs to be called at the client end of an MQI channel.
If a channel uses the Secure Sockets Layer (SSL), a client application can also provide information relating to SSL in the MQCD structure. Additional information relating to SSL can be provided in the SSL configuration options structure, MQSCO, which is also referenced by the MQCNO structure on an MQCONNX call.
For more information about the MQCNO, MQCD, and MQSCO structures, see the WebSphere MQ Application Programming Reference.
Note: