Vignesh
Vignesh

Reputation: 1079

Monitoring queue having old message

We have a queue which needs to be monitored for message not being processed for a long time. we set QSVCINT(1800000) that is 30 mins.

This event occurs only if there is no successful get operations or MQPUT calls have been detected within an interval greater than the limit specified. (30 minutes)

In our case queue is continuously getting message(MQPUT) in 30 minutes interval of time, so service interval high is not triggered.

Do we have any alternative to check the age of the message and get alerted?

Upvotes: 3

Views: 4461

Answers (1)

T.Rob
T.Rob

Reputation: 31832

Before answering the question, let's reset a slight misconception in the premise. Queue Service Interval measures the time between a PUT to an empty queue or a GET that does not empty the queue and the next GET. So the reason that you are not getting any event messages is not due to PUT activity but rather to a lack of GET activity that would trigger an event. In other words, once the queue has depth, you will not get any QSVCINTVL events until a GET occurs. Also, the events toggle between OK and HIGH so that once you get a HIGH you will not get another HIGH but should eventually see an OK. Once you get the OK event you won't get another until a HIGH condition occurs as a result of a late GET.

So imagine that a program puts 10 messages on the queue and another reads the first message and then dies. The PUT calls will not generate an event but will start the timer. Since the now-non-empty queue defaults to an OK interval state, no event is enerated on the first GET which we stipulated occured immediately. Since there were no subsequent GET calls, the timer continues to run but no event will be generated. New messages can continue to arrive but the event will only trigger at this point on a GET call that occurs 30 or more minutes after the one successful GET.

If you were hoping to get a QSVCINTVL(HIGH) event base don no GET activity for more than 30 miniutes, it does not work that way.

Still with me? Great! Now on to the answer.

If you display the queue status (for example using the DIS QS(QUEUE.NAME) command) it provides the last GET time and date. The DIS QL(QUEUE.NAME) CURDEPTH command provides the depth of the queue. These two commands can be issued to runmqsc in scripts or directly to the command server using PCF commands and will allow you to directly inquire as to the time since the last successful GET on the queue, irrespective of any GET activity such as that required to drive events.

Using this method you can first validate that the queue has depth (because presumably we don't care if there are no GET calls on an empty queue) and then if so, see how long it's been since the last GET even if the consuming program has died and there are no GET calls being made.

Hope that helps.

Upvotes: 3

Related Questions