ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Check whether queues are empty?

Post new topic  Reply to topic Goto page Previous  1, 2, 3
 Check whether queues are empty? « View previous topic :: View next topic » 
Author Message
PeterPotkay
PostPosted: Wed Oct 17, 2007 3:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
koen.jans
PostPosted: Wed Oct 17, 2007 11:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3 Page 3 of 3

MQSeries.net Forum Index » IBM MQ Java / JMS » Check whether queues are empty?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.