|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Check whether queues are empty? |
« View previous topic :: View next topic » |
Author |
Message
|
PeterPotkay |
Posted: Wed Oct 17, 2007 3:18 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
koen.jans wrote: |
.... a reply must be send to the external application that all processing has stopped. |
So how do you know "all processing has stopped"?
Just have your MQ monitor do what you would do to come to that conclusion. If you would know processing has stopped because the queues have been empty with no throughput for x seconds, have your MQ monitoring tool alert on this condition (both q depth = 0 AND dequeue count = 0) and send the all done message.
To me that's a bit wishy-washy. I would prefer the consuming apps to positivily confirm, i.e. push, the notification that they are done. Will they know when they have processed the last logical message? If not, they simply eat whatever's there, then empty queues for x seconds truly is your all clear trigger and let the MQ monitor do its thing as described above. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
koen.jans |
Posted: Wed Oct 17, 2007 11:09 pm Post subject: |
|
|
Novice
Joined: 16 Oct 2007 Posts: 12
|
PeterPotkay wrote: |
To me that's a bit wishy-washy. I would prefer the consuming apps to positivily confirm, i.e. push, the notification that they are done. Will they know when they have processed the last logical message? If not, they simply eat whatever's there, then empty queues for x seconds truly is your all clear trigger and let the MQ monitor do its thing as described above. |
The consuming app has no idea that processing is done; messages flow in on a constant base because events are triggered from the queue from the external app to my app. It's not a perfect, but in practice, it's an acceptable solution to stop the listenerport on that external queue and then 'wait' x seconds for a check if all internal queues are empty.
Still, i'm looking to perform this check in a simple way:
- depending on queue monitor tools is not an option
- using low level code is to be avoided
I'm looking for a solution on the websphere side here like:
Code: |
ObjectName listenerPort = new ObjectName("WebSphere:cell=" +
currentApplicationServerVO.getCellName() + ",node=" +
currentApplicationServerVO.getNodeName() + ",process=" +
currentApplicationServerVO.getServerName() + ",type=?,*");
Set listenerPorts AdminServiceFactory.getAdminService().queryNames(listenerPort, null);
???? queue = // get the destination queue from the listenerport?
Object queueDepth = service.getAttribute(qeueu , "depth");
int myQueueDepth = ((Integer)queueDepth).intValue();
|
|
|
Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|