Queue service interval events

 


Overview

Queue service interval events indicate whether a queue was 'serviced' within a user-defined time interval called the service interval and are used to monitor whether messages are being taken off queues quickly enough.

The following are types of queue service interval events:

  1. Queue Service Interval OK event

    Indicates that after one of the following...

    • An MQPUT call
    • An MQGET call that leaves a non-empty queue

    ...an MQGET call was performed within a user-defined time period, known as the service interval.

    The Queue Service Interval OK event message can only be caused by an MQGET call.

    Queue Service Interval OK events are also known as OK events.

  2. Queue Service Interval High event

    Indicates that after one of the following:

    • An MQPUT call
    • An MQGET call that leaves a non-empty queue

    ...an MQGET call was NOT performed within a user-defined service interval.

    The Queue Service Interval High event message can be caused by an MQGET or a MQPUT call.

    Queue Service Interval High events are also known as high events.

 

Enabling queue service interval events

To configure a queue for queue service interval events :

  1. Enable performance events on the queue manager, using the queue manager attribute PerformanceEvent (PERFMEV in MQSC).

  2. Set the control attribute, QServiceIntervalEvent, for a Queue Service Interval High or OK event on the queue, as required (QSVCIEV in MQSC).

  3. Specify the service interval time by setting the QServiceInterval attribute for the queue to the appropriate length of time (QSVCINT in MQSC).

For example, to enable Queue Service Interval High events with a service interval time of 10 seconds (10 000 milliseconds) use the following MQSC commands:

  
ALTER QMGR +
  PERFMEV(ENABLED)
 
ALTER QLOCAL('MYQUEUE') +
      QSVCINT(10000) +
      QSVCIEV (HIGH)

When enabled, a queue service interval event can only be generated on an MQPUT call or an MQGET call. The event is not generated when the elapsed time becomes equal to the service interval time.

To enable both Queue Service Interval OK and Queue Service Interval High events set QServiceIntervalEvent to High These events are mutually exclusive, which means that if one is enabled the other is disabled. However, both events can be simultaneously disabled.

In terms of queue service interval events, these are the possible outcomes:

  • If the elapsed time between the put and get is less than or equal to the service interval:

    • A Queue Service Interval OK event is generated at G1, if queue service interval events are enabled

  • If the elapsed time between the put and get is greater than the service interval:

    • A Queue Service Interval High event is generated at G1, if queue service interval events are enabled.

The actual algorithm for starting the service timer and generating events is described in Queue service interval events algorithm.

 

Understanding the service timer

Queue service interval events use an internal timer, called the service timer, which is controlled by the queue manager. The service timer is used only if one or other of the queue service interval events is enabled.

What precisely does the service timer measure?
The service timer measures the elapsed time between an MQPUT call to an empty queue or an MQGET call and the next put or get, provided the queue depth is nonzero between these two operations.

When is the service timer active?
The service timer is always active (running), if the queue has messages on it (depth is nonzero) and a queue service interval event is enabled. If the queue becomes empty (queue depth zero), the timer is put into an OFF state, to be restarted on the next put.

When is the service timer reset?
The service timer is always reset after an MQGET call. It is also reset by an MQPUT call to an empty queue. However, it is not necessarily reset on a queue service interval event.

How is the service timer used?
Following an MQGET call or an MQPUT call, the queue manager compares the elapsed time as measured by the service timer, with the user-defined service interval. The result of this comPARISon is that:

  • An OK event is generated if the operation is an MQGET call and the elapsed time is less than or equal to the service interval, AND this event is enabled.

  • A high event is generated if the elapsed time is greater than the service interval, AND this event is enabled.

Can applications read the service timer?
No, the service timer is an internal timer that is not available to applications.

What about the TimeSinceReset parameter?
The TimeSinceReset parameter is returned as part of the event statistics in the event data. It specifies the time between successive queue service interval events, unless the event statistics are reset.

 

Queue service interval events algorithm

This section gives the formal rules associated with the timer and the queue service interval events.

 

Service timer

The service timer is reset to zero and restarted:

  • Following an MQPUT call to an empty queue.

  • Following an MQGET call, if the queue is not empty after the MQGET call.

The resetting of the timer does not depend on whether an event has been generated.

At queue manager startup the service timer is set to startup time if the queue depth is greater than zero.

If the queue is empty following an MQGET call, the timer is put into an OFF state.

 

Queue Service Interval High events

The Queue Service Interval event must be enabled (set to HIGH).

If the service time is greater than the service interval, an event is generated on the next MQPUT or MQGET call.

 

Queue Service Interval OK events

Queue Service Interval OK events are automatically enabled when a Queue Service Interval High event is generated.

If the service time (elapsed time) is less than or equal to the service interval, an event is generated on the next MQGET call.

 

Enabling queue service interval events

When enabled, a queue service interval event can only be generated on an MQPUT call or an MQGET call. The event is not generated when the elapsed time becomes equal to the service interval time.

 

Automatic enabling of queue service interval events

The high and OK events are mutually exclusive; that is, when one is enabled, the other is automatically disabled.

When a high event is generated on a queue, the queue manager automatically disables high events and enables OK events for that queue.

Similarly, when an OK event is generated on a queue, the queue manager automatically disables OK events and enables high events for that queue.

All performance events must be enabled using the queue manager attribute PERFMEV.

Table 4. Enabling queue service interval events using MQSC

Queue service interval event
Queue attributes
Queue Service Interval High
Queue Service Interval OK
No queue service interval events
QSVCIEV (HIGH)
QSVCIEV (OK)
QSVCIEV (NONE)
Service interval
QSVCINT (tt) where tt is the service
interval time in milliseconds.