Examples of channel weighting and affinity
These examples illustrate how client-connection channels are selected when non-zero ClientChannelWeights are used.
The ClientChannelWeight and ConnectionAffinity channel attributes control how client-connection channels are selected when more than one suitable channel is available for a connection. These channels are configured to connect to different queue managers in order to provide higher availability, workload balancing, or both. MQCONN calls that could result in a connection to one of several queue managers must prefix the queue manager name with an asterisk as described in: Examples of MQCONN calls: Example 1. Queue manager name includes an asterisk (*).
Applicable candidate channels for a connection are those where the QMNAME attribute matches the queue manager name specified in the MQCONN call. If all applicable channels for a connection have a ClientChannelWeight of zero (the default) then they are selected in alphabetical order as in the example: Examples of MQCONN calls: Example 1. Queue manager name includes an asterisk (*).
The following examples illustrate what happens when non-zero ClientChannelWeights are used. Note that, since this feature involves pseudo-random channel selection, the examples show a sequence of actions that might happen rather than what definitely will.
- Example 1. Selecting channels when ConnectionAffinity is set to PREFERRED
This example illustrates how an IBM MQ MQI client selects a channel from a CCDT, where the ConnectionAffinity is set to PREFERRED. - Example 2. Selecting channels when ConnectionAffinity is set to NONE
This example illustrates how an IBM MQ MQI client selects a channel from a CCDT, where the ConnectionAffinity is set to NONE.
Parent topic: Connect IBM MQ MQI client applications to queue managers