Create one definition on the client and the other on the server

 

You can use MQSC commands to define a server-connection channel on the server machine. Because MQSC commands are not available on a machine where WebSphere MQ has been installed as a WebSphere MQ client only, use different ways of defining a client-connection channel on the client machine.

 

On the server

You first create and start a queue manager and then start MQSC commands.

 

Creating a queue manager and starting MQSC on the server

  1. Create a queue manager, called PARIS for example:
    crtmqm PARIS
    

  2. Start the queue manager:
    strmqm PARIS
    

  3. Start MQSC commands.

    runmqsc PARIS
    

For MQSeries Version 5.1 or later products, the default objects are defined automatically when you create the queue manager.

 

Defining the server-connection channel

Define a channel with your chosen name and a channel type of server-connection. This channel definition is associated with the queue manager running on the server.

For example:

DEFINE CHANNEL(CHAN1) CHLTYPE(SVRCONN) TRPTYPE(TCP) +
DESCR('Server-connection to Client_1')

 

On the WebSphere MQ client

There are two ways of defining a client-connection channel on the client machine.

 

Using MQSERVER

You can use the MQSERVER environment variable to specify a simple definition of a client-connection channel. It is simple in the sense that you can specify only a few attributes of the channel using this method.

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:

    • LU62
    • TCP
    • NETBIOS
    • SPX
    • DECNET

    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 recognized

  • ConnectionName is the name of the server machine as defined to the communications protocol (TransportType).

#INTER should be the ModeName of choice for most occasions. You can also specify Modename and TpName in your Communications Manager/2 profile.

For example:

export MQSERVER=CHAN1/TCP/'MCID66499'

Some examples of a simple channel definition on a UNIX system are:

export MQSERVER=CHAN1/TCP/'9.20.4.56'
export MQSERVER=CHAN1/LU62/BOX99

Where 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.

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 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.

A sample connect program called amqscnxc demonstrates the use of this function.

 

 

 

 

 

 

 

 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.