Example 2 (queue service interval events)

This example illustrates a sequence of MQPUT calls and MQGET calls, where the queue depth is not always one or zero. It also shows instances of the timer being reset without events being generated, for example, at T(P2)

Figure 5. Queue service interval events - example 2
 Illustration showing a graph of queue depth against time for two put and get operations. There are five points along the time axis:  T0  The initial point of interest. The queue depth is at its lowest point. P1   The first put command is invoked. The queue depth increases The first service interval starts here. The service timer is switched on. P2  The second put command is invoked. The queue depth increases again. G1  The first get command is invoked. The queue depth decreases back to its previous level. The first service interval ends before this point. The service timer is restarted. G2  The second get command is invoked. The queue depth decreases back to its original level. The second service interval ends after this point. A Queue Service Interval OK event is generated. The service timer switched off.

Commentary

In this example, OK events are enabled initially and queue statistics were reset at T(0).

  1. At P1, the first put starts the service timer.
  2. At P2, the second put does not generate an event because a put cannot cause an OK event.
  3. At G1, the service interval has now been exceeded and therefore an OK event is not generated. However, the MQGET call causes the service timer to be reset.
  4. At G2, the second get occurs within the service interval and this time an OK event is generated. The queue manager resets the event control attribute so that:
    1. The high event is automatically enabled.
    2. The OK event is disabled.

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

Event statistics summary for example 2

Table 7 summarizes the event statistics for this example.

Table 7. Event statistics summary for example 2
Time of event T(G2)
Type of event OK
TimeSinceReset T(G2) - T(0)
HighQDepth 2
MsgEnqCount 2
MsgDeqCount 2