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.

In this example, a number of clients use a Client Channel Definition Table (CCDT) provided by a queue manager. The CCDT includes client connection channels with the following attributes (shown using the syntax of the DEFINE CHANNEL command):
CHANNEL(A) QMNAME(DEV) CONNAME(devqm.it.company.example)
CHANNEL(B) QMNAME(CORE) CONNAME(core1.ops.company.example) CLNTWGHT(5) +
AFFINITY(NONE)
CHANNEL(C) QMNAME(CORE) CONNAME(core2.ops.company.example) CLNTWGHT(3) +
AFFINITY(NONE)
CHANNEL(D) QMNAME(CORE) CONNAME(core3.ops.company.example) CLNTWGHT(2) +
AFFINITY(NONE)
The application issues MQCONN(*CORE). As in the previous example, channel A is not considered because the QMNAME does not match. Channel B, C, or D are selected based on their weighting, with probabilities of 50%, 30%, or 20%. In this example, channel B might be selected. There is no persistent order of preference created.

A second MQCONN(*CORE) call is made. Again, one of the three applicable channels is selected, with the same probabilities. In this example, channel C is chosen. However, core2.ops.company.example does not respond, so another choice is made between the remaining candidate channels. Channel B is selected and the application is connected to core1.ops.company.example.

With AFFINITY(NONE), each MQCONN call is independent of any other. Therefore when this example application makes a third MQCONN(*CORE), it might once more attempt to connect through the broken channel C, before choosing one of B or D.

Parent topic: Examples of channel weighting and affinity