Message age on queues

Is there anyway we can get the message age from the queues other than UMEM? I am trying to use npeekq to get the Current queue age, but for some strange reason, the Current queue age the npeekq outputs is the time difference in the last two messages. I am trying to find how long the last message has been on the queue.

Hey Abdul,

The “Current queue age” value printed from the npeekq sample app is actually the time between the oldest and the newest events on the queue.

If you want to check if an event was more than 24 hours on a queue you can use a queue reader as described in the documentation - https://techcommunity.softwareag.com/ecosystem/documentation/onlinehelp/Rohan/num10-1/10-1_UM_webhelp/index.html#page/um-webhelp/co-queuebrowse_3.html. All you should do is take the time when the event was published and then check for how long it has been on the store, e.g. :

public void go(nConsumeEvent event) {
Timestamp timePublished = new Timestamp(event.getHeader().getTimestamp());
System.out.println("Consumed event "+event.getEventID() + "; Event was published : " + timePublished);
// compare the timePublished of the event with the current timestamp
}

Rado