Message queue monitors (*MSGQ) - assure_mimix - 10.0

Assure MIMIX Monitor Reference

Product type
Product family
Assure MIMIX™ Software
Product name
Assure MIMIX
Assure MIMIX Monitor Reference
First publish date

You can use message queue monitors (*MSGQ)  to define a message queue and a list of message identifiers (including generic values) for which to monitor. There is a separate monitor job for each monitor object definition of this event class. When a message arrives on the message queue, it is compared to the list of monitored message IDs. If the monitor receives a message ID that appears in the list then the condition program runs. If the conditions are met, the event program runs. Message IDs that arrive on the queue before the message queue monitor is started are ignored. Only messages that arrive on the message queue while the monitor is active are processed.

Message queue monitors have a process type parameter that determines whether message IDs that meet the selection criteria are processed synchronously or asynchronously. In synchronous processing, condition and event programs are called by the message queue monitor and must complete before the next message on the queue is received. In asynchronous processing, a separate job is started to process the message, call the condition and event programs, and update the status of the monitor upon completion. Asynchronous processing allows the monitor to immediately process the next message in the queue without waiting for processing of the previous message to complete.

A synchronous message queue monitor can also specify a retry attempt value. When a retry value is specified, multiple messages must arrive that meet the monitoring criteria and the condition program will be called each time before the event program is called.

You should ensure that no other processes, including another message queue monitor, receive messages from the monitored message queue. Also, you should not use the Clear Message Queue (CLRMSGQ) command while a monitor is processing messages from a message queue. Message queue monitors use the message key to identify the last message that was processed from the monitored queue and thereby determine the next message to receive. When certain commands are used on a message whose key is being processed by the message queue monitor, the message key can become not valid. These commands are the CLRMSGQ command and the Receive Message (RCVMSG) command when RMV(*YES) is specified. If a new message arrives in the queue that fits into the same space as the removed message, the new message may be assigned the same key. If this situation occurs before MIMIX Monitor resets the key that is not valid, the message queue monitor may omit unprocessed messages and resume processing at the wrong location. However, if the monitor determines that the key has become not valid the primary and secondary message queues and the message log are notified. The message queue monitor will receive the last message on the queue, as it does when the monitor is first started, and resume receiving messages from that point.

For more information see Working with the message log.