Example 1 (queue service interval events)

This example shows a simple sequence of MQGET calls and MQPUT calls, where the queue depth is always one or zero.

Figure 4. Queue service interval events - example 1

 

Commentary

  1. At P1, an application puts a message onto an empty queue. This starts the service timer.

    Note that T0 may be queue manager startup time.

  2. At G1, another application gets the message from the queue. Because the elapsed time between P1 and G1 is greater than the service interval, a Queue Service Interval High event is generated on the MQGET call at G1. When the high event is generated, the queue manager resets the event control attribute so that:

    1. The OK event is automatically enabled.

    2. The high event is disabled.

    Because the queue is now empty, the service timer is switched to an OFF state.

  3. At P2, a second message is put onto the queue. This restarts the service timer.

  4. At G2, the message is removed from the queue. However, because the elapsed time between P2 and G2 is less than the service interval, a Queue Service Interval OK event is generated on the MQGET call at G2. When the OK event is generated, the queue manager resets the control attribute so that:

    1. The high event is automatically enabled.

    2. The OK event is disabled.

    Because the queue is empty, the service timer is again switched to an OFF state.

 

Event statistics summary for example 1

Table 6 summarizes the event statistics for this example.

Table 6. Event statistics summary for example 1
Event 1 Event 2
Time of event T(G1) T(G2)
Type of event High OK
TimeSinceReset T(G1) - T(0) T(G2) - T(P2)
HighQDepth 1 1
MsgEnqCount 1 1
MsgDeqCount 1 1

The middle part of Figure 4 shows the elapsed time as measured by the service timer compared to the service interval for that queue. To see whether a queue service interval event will occur, compare the length of the horizontal line representing the service timer (with arrow) to that of the line representing the service interval. If the service timer line is longer, and the Queue Service Interval High event is enabled, a Queue Service Interval High event will occur on the next get. If the timer line is shorter, and the Queue Service Interval OK event is enabled, a Queue Service Interval OK event will occur on the next get.