Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC4CA62CD for ; Thu, 16 Jun 2011 17:38:59 +0000 (UTC) Received: (qmail 51829 invoked by uid 500); 16 Jun 2011 17:38:59 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 51801 invoked by uid 500); 16 Jun 2011 17:38:59 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 51793 invoked by uid 99); 16 Jun 2011 17:38:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 17:38:59 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jasonwhaley@gmail.com designates 209.85.161.43 as permitted sender) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 17:38:54 +0000 Received: by fxm3 with SMTP id 3so1712372fxm.2 for ; Thu, 16 Jun 2011 10:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=LcqYAk7BMLo0KSRP6JPrBN8UEC4kypX50nmva2bX8W8=; b=ordJ+L6hLvto1xlOlZHLQhNHHxG3V4df2w7GKc1wwTz56xWgBdpkkUvPkAyG0v7+dI jw1a8ctdgjes2Pgdq978n9XCOr247oZMXn0VkHR8auBGKabLBMJuuQXOl1WW4ucQI+eW KgSmHeC0yyu/D9YtaeuO+0ZF76/KRvzCLHwSg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=E/B/aGuy1dkcVYp6JqxHXySMlYWcfeZE9DYo4izSQSuM7XHYAY0+OuW8VheXOlwdcC j2/U6GPlXv//oyqFuBKyEnUX8FoXveoiGYiWfFl949zcWDpvA7n1cnZriL6067gzSToe QZ+vL/ty+OsGBL40DnP6yzYRUKNr0NiGGyjFY= MIME-Version: 1.0 Received: by 10.223.143.20 with SMTP id s20mr1459192fau.10.1308245911306; Thu, 16 Jun 2011 10:38:31 -0700 (PDT) Received: by 10.223.104.209 with HTTP; Thu, 16 Jun 2011 10:38:31 -0700 (PDT) In-Reply-To: <57543684A62D694282FEA49A4CC2C9110FEC9E9051@34093-MBX-C05.mex07a.mlsrvr.com> References: <57543684A62D694282FEA49A4CC2C9110FEC9E8D84@34093-MBX-C05.mex07a.mlsrvr.com> <57543684A62D694282FEA49A4CC2C9110FEC9E9051@34093-MBX-C05.mex07a.mlsrvr.com> Date: Thu, 16 Jun 2011 11:38:31 -0600 Message-ID: Subject: Re: Detect empty Queue programmatically From: Jason Whaley To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=0023545bd3ecd2832f04a5d7bc1b --0023545bd3ecd2832f04a5d7bc1b Content-Type: text/plain; charset=ISO-8859-1 Out of curiosity, what is the purpose of detecting an empty queue and firing off this query? What is the end goal you are attempting to accomplish? Perhaps there's a better solution than trying to determine if the queue is empty. On Wed, Jun 15, 2011 at 11:56 AM, Yuvaraj Vanarase < yuvaraj.vanarase@synechron.com> wrote: > Thanks Jason, > > I am trying to know if there is way to create and register some listener to > Broker so that Broker will callback some method on listener when queue > becomes empty on broker. In this way, client doesn't have to poll queue to > know if all messages are consumed. > Well, I do also think it may not happening that Broker itself knows when > queue becomes empty, then above requirement is nonsense. In this case is the > polling/checking queue messages remaining is the solution? > > Regards, > Yuvaraj > > Yuvaraj Vanarase, > Lead Technology - Software > Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 | > http://www.synechron.com > SYNECHRON - > - Top 10 Best IT Employers for 4 consecutive years (link). > - Celebrating 10 Years! > > > -----Original Message----- > From: Jason Whaley [mailto:jasonwhaley@gmail.com] > Sent: Wednesday, June 15, 2011 8:07 PM > To: users@activemq.apache.org > Subject: Re: Detect empty Queue programmatically > > I'm not sure if by saying "I do not want to poll the queue to see remaining > messages" means you are ruling out polling JMX also, but you could very > well > monitor a Queue's QueueSize attribute via JMX and take action when it is 0. > > > Here's a link to at least setting up JMX on the broker with some other > details http://activemq.apache.org/jmx.html . > > On Tue, Jun 14, 2011 at 10:54 PM, Yuvaraj Vanarase < > yuvaraj.vanarase@synechron.com> wrote: > > > Hi, > > > > I would like to fire some sql query when all messages are processed from > > Queue ie. Queue becomes empty. I do not want to poll the queue to see > > remaining messages. Is there any way by which activemq will deliever an > > event to some listener? Like we have advisory message listener. > > > > Regards, > > Yuvaraj > > > > Yuvaraj Vanarase, > > Lead Technology - Software > > Phone: +91.20.40262000 Ext 2305|Mobile: +91.9850818870 | > > http://www.synechron.com > > SYNECHRON - > > - Top 10 Best IT Employers for 4 consecutive years (link< > > http://www.synechron.com/news/news_best_employer_sep2010.htm>). > > - Celebrating 10 Years! > > > > > --0023545bd3ecd2832f04a5d7bc1b--