defining, MQEnvironment" /> Defining which connection type to use

 

Defining which connection type to use

The connection type is determined by the setting of the connection name, channel name, the

customization value

NMQ_MQ_LIB

and the property MQC.TRANSPORT_PROPERTY

.

We can specify the connection name as follows:

We can specify the channel name as follows:

We can set the

customization value

NMQ_MQ_LIB to explicitly choose the connection type as shown in the following table

NMQ_MQ_LIB value Connection type
mqic32.dll Connect as a non-XA client
mqic32xa.dll Connect as an XA client
mqm.dll Connect as a server

managed

Connect as a

non-

XA managed client

If you choose a connection type which is unavailable in your environment, for example you specify mqic32xa.dll and don't have XA support, WebSphere MQ .NET throws an exception.

WebSphere MQ .NET chooses the connection type as follows:

  1. If MQC.TRANSPORT_PROPERTY is specified, it connects according to the value of MQC.TRANSPORT_PROPERTY.

  2. If a connection name has been specified without a channel name, or a channel name has been specified without a connection name, it throws an error.

  3. If both a connection name and a channel name have been specified:

    • If NMQ_MQ_LIB is set to mqic32xa.dll, it connects as an XA client.

    • If NMQ_MQ_LIB is set to managed, it connects as a managed client.

    • Otherwise it connects as a non-XA client.

  4. If NMQ_MQ_LIB is specified, it connects according to the value of NMQ_MQ_LIB.

  5. If a WebSphere MQ server is installed, it connects as a server.

  6. If a WebSphere MQ client is installed, it connects as a non-XA client.

  7. Otherwise, it connects as a managed client.


defconn