Enabling queue depth events
To configure a queue for any of the queue depth events you set the appropriate queue manager and queue attributes.
About this task
By default, all queue depth events are disabled. When enabled, queue depth events are generated as follows:
- A Queue Depth High event is generated when a message is put on the queue, causing the queue depth to be greater than or equal to the value determined by the Queue Depth High limit.
- A Queue Depth High event is automatically enabled by a Queue Depth Low event on the same queue.
- A Queue Depth High event automatically enables both a Queue Depth Low and a Queue Full event on the same queue.
- A Queue Depth Low event is generated when a message is removed from a queue by a get operation causing the queue depth to be less than or equal to the value determined by the Queue Depth Low limit.
- A Queue Depth Low event is automatically enabled by a Queue Depth High event or a Queue Full event on the same queue.
- A Queue Depth Low event automatically enables both a Queue Depth High and a Queue Full event on the same queue.
- A Queue Full event is generated when an application is unable to put a message onto a queue because the queue is full.
- A Queue Full event is automatically enabled by a Queue Depth High or a Queue Depth Low event on the same queue.
- A Queue Full event automatically enables a Queue Depth Low event on the same queue.
Perform the following steps to configure a queue for any of the queue depth events:
Procedure
- Enable performance events on the queue manager, using the queue manager attribute PERFMEV. The events go to the SYSTEM.ADMIN.PERFM.EVENT queue.
- Set one of the following attributes to enable the event on the required queue:
- QDepthHighEvent (QDPHIEV in MQSC)
- QDepthLowEvent (QDPLOEV in MQSC)
- QDepthMaxEvent (QDPMAXEV in MQSC)
- Optional: To set the limits, assign the following attributes, as a percentage of the maximum queue depth:
Restriction: QDEPTHHI must not be less than QDEPTHLO.
- QDepthHighLimit (QDEPTHHI in MQSC)
- QDepthLowLimit (QDEPTHLO in MQSC)
If QDEPTHHI equals QDEPTHLO an event message is generated every time the queue depth passes the value in either direction, because the high threshold is enabled when the queue depth is below the value and the low threshold is enabled when the depth is above the value.
Results
Note:A Queue Depth Low event is not generated when expired messages are removed from a queue by a get operation causing the queue depth to be less than, or equal to, the value determined by the Queue Depth Low limit.
IBM MQ generates the low event message only during a successful get operation. Therefore, when the expired messages are removed from the queue, no queue depth low event message is generated.
Additionally, after the removal of these expired messages from the queue, queue depth high event and queue depth low event are not reset.
Example
To enable Queue Depth High events on the queue MYQUEUE with a limit set at 80%, use the following MQSC commands:
ALTER QMGR PERFMEV(ENABLED) ALTER QLOCAL('MYQUEUE') QDEPTHHI(80) QDPHIEV(ENABLED)To enable Queue Depth Low events on the queue MYQUEUE with a limit set at 20%, use the following MQSC commands:
ALTER QMGR PERFMEV(ENABLED) ALTER QLOCAL('MYQUEUE') QDEPTHLO(20) QDPLOEV(ENABLED)To enable Queue Full events on the queue MYQUEUE, use the following MQSC commands:
ALTER QMGR PERFMEV(ENABLED) ALTER QLOCAL('MYQUEUE') QDPMAXEV(ENABLED)