How a .NET application determines what channel definition to use
In the IBM MQ .NET client environment, the channel definition to be used can be specified in a number of different ways. Multiple specifications of the channel definition can exist. An application derives the channel definition from one or more sources.
If more than one channel definition exists, the one used is selected in the following priority order:- Properties specified on the MQQueueManager constructor, either explicitly or by including MQC.CHANNEL_PROPERTY in the properties hashtable
- A property MQC.CHANNEL_PROPERTY in the MQEnvironment.properties hashtable
- The property Channel in MQEnvironment
- The .NET application configuration file, section name CHANNELS, key ServerConnectionParms (applies to managed connections only)
- The MQSERVER environment variable
- The client configuration file, stanza CHANNELS, Attribute ServerConnectionParms
- The client channel definition table (CCDT). The location of the CCDT is specified in the .NET application configuration file (applies to managed connections only)
- The client channel definition table (CCDT). The location of the CCDT is specified using the environment variables MQCHLIB and MQCHLTAB
- The client channel definition table (CCDT). The location of the CCDT is specified using the client configuration file
For items 1-3, the channel definition is built up field by field from values provided by the application. These values can be provided using different interfaces and multiple values can exist for each one. Field values are added to the channel definition following the priority order given:
- The value of connName on the MQQueueManager constructor
- Values of properties from the MQQueueManager.properties hashtable
- Values of properties from the MQEnvironment.properties hashtable
- Values set as MQEnvironment fields (for example, MQEnvironment.Hostname, MQEnvironment.Port)
For items 4-6, the entire channel definition is supplied as the value. Unspecified fields on the channel definition take the system defaults. No values from other methods of defining channels and their fields are merged with these specifications.
For items 7-9, the entire channel definition is taken from the CCDT. Fields which were not specified explicitly when the channel was defined take the system defaults. No values from other methods of defining channels and their fields are merged with these specifications.
Parent topic: Writing and deploying IBM MQ .NET programs