During initialization of MQ decollating missions the Control‑D monitor creates a special MQN table. The MQN table, which functions similarly to the GENCLASS list from the CTDPARM library, contains all MQ queue names from the MQ decollation mission definitions.
The Control‑D monitor looks through the MQN table and checks each MQ queue name in the table for a message in the corresponding queue. If a message is not found, the Control‑D monitor checks for the next MQ name in the MQN table.
If several Control-D monitors are configured to process the same MQ queue, Control-D needs a synchronization mechanism to avoid having different Control-D monitor processing the same MQ message. For this purpose, the first monitor accessing the MQ queue has exclusive access to it. Until the queue is closed, only that monitor can remove or browse messages from it. After the queue is closed, the MQ queue is accessible to other monitors.
As soon as a message is found in a queue, the Control‑D monitor checks all ON MQ statements of the MQ decollation missions against the descriptor of the received MQ message. If no appropriate mission is found, the message is moved to the MQ escape queue, which is defined in the CTDMQPRM member by the MQNOTFIND parameter. (See CTDMQPRM Parameters.) If there are several MQ decollation mission definitions with the same ON MQ selection criteria in the Active Missions File, only the first one with the highest priority will process the received message.
A decollation mission begins to work from the selected message if the ON MQ statement matches the descriptor of the MQ message. After the message is processed, Control-D tries to read the next message from the same MQ queue and checks it against the current decollation mission. If the next selected message does not match any ON statement of the current decollation mission, this decollation mission terminates and the Control-D monitor returns to check the next message in queue in the MQN table. The next cycle of MQ message processing will begin after the last rejected message.
If no appropriate MQ decollation mission is found for selected message, it's moved to special MQ queue defined in MQNOTFIND parameter.
The number of messages that can be processed in one cycle by the same decollation mission is limited by the MAX MSG parameter in the decollation mission definition. The maximum number of cycles is defined by Optional Wish WD2012 (the default is 8).