Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 6786 invoked from network); 8 Mar 2011 17:58:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Mar 2011 17:58:02 -0000 Received: (qmail 62278 invoked by uid 500); 8 Mar 2011 16:58:02 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 62260 invoked by uid 500); 8 Mar 2011 16:58:02 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 62247 invoked by uid 99); 8 Mar 2011 16:58:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 16:58:02 +0000 X-ASF-Spam-Status: No, hits=3.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rajith77@gmail.com designates 74.125.82.52 as permitted sender) Received: from [74.125.82.52] (HELO mail-ww0-f52.google.com) (74.125.82.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 16:57:56 +0000 Received: by wwj40 with SMTP id 40so1443819wwj.33 for ; Tue, 08 Mar 2011 08:57:34 -0800 (PST) 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:cc:content-type; bh=sTuw7zLq2z55GacGmEm7vfHbCOTrETKJg3uR6grnjPE=; b=d1Yn8UAWnFjCE33NqpICiVq2NOVjgAm4RCqwF/TgNinspsh6mtnEVkTLcjwEEGkVds MFPzIlkz8npxldt4IR+ZZ2CP1TZ8Iuqz40L9J7sTioITmC26fxwX5cEwlSdFCifzez5q nUaQPXFcvgss1X09IlzuixRO03ZT3WFXFl2yw= 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 :cc:content-type; b=u4bHTtaRR7EyfilUEmhRhZZ6RHeA+G/ne70JpdbrMDoeCzyugUxQM//RANxRM6b09D D0OHdDy+3vx3yGiXGE+klqsXq2i8IPaujEFt6HY+pMTj+bDVrGfBN/EpMtuaw6pfUvUs rCBK4Bkvpu3a62CQLFKXlWqcaH4AMIWhj40FE= MIME-Version: 1.0 Received: by 10.227.0.140 with SMTP id 12mr4788674wbb.122.1299603454766; Tue, 08 Mar 2011 08:57:34 -0800 (PST) Received: by 10.227.134.193 with HTTP; Tue, 8 Mar 2011 08:57:34 -0800 (PST) In-Reply-To: References: Date: Tue, 8 Mar 2011 11:57:34 -0500 Message-ID: Subject: Re: getEnumeration() creates new connections/consumers From: Rajith Attapattu To: users@qpid.apache.org Cc: Kim Garcia Content-Type: multipart/alternative; boundary=002215b03106452e5e049dfb8220 --002215b03106452e5e049dfb8220 Content-Type: text/plain; charset=ISO-8859-1 Kim, I am trying to understand your use case a bit more in detail. Perhaps the QueueBrowser may not be the optimal solution here. (a) Are you only interested in just the new messages coming into the ring queue ? i.e get notified about updates in a non-consuming manner ? (b) Or do you need to look at the entire queue each time you invoke getEnumeration() ? If it's (a) then you can create a regular consumer using the addressing syntax and use browse mode. Further you could use a message listener to receive updates asynchronously as well. Here is an example address string that does the above. "my-ring-queue; {mode: browse}" - where my-ring-queue is a ring queue that already exists when you start the consumer. Does that help ? Regards, Rajith On Mon, Mar 7, 2011 at 12:55 PM, Kim Garcia wrote: > > Hello, > > I have a static ring queue which I am polling for messages. I created a > QueueBrowser object and use it to call getEnumeration() to get all of the > messages on the queue. This is in a while loop and I have it sleep for a > short while in between iterations. Also I am using MRG 1.3. > > While this was running I didn't notice anything unusual in my application, > but when I log onto the MRG server and monitor the queue size, rate the > messages are enqueued/dequeued, ect, I noticed that the number of consumers > was increasing. I put a print statement every time getEnumeration() is > called and included a counter. I ran my app again and saw that as my > getEnumeration() statement printed out and the counter increased, the > numbers of consumers increased and the numbers matched. > > As a work around, I close the QueueBrowser and recreate it every time I > want to call getEnumeration(). Has anyone else seen this happen? > > Thank you. --002215b03106452e5e049dfb8220--