Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 48509 invoked from network); 9 Mar 2011 10:58:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Mar 2011 10:58:44 -0000 Received: (qmail 34083 invoked by uid 500); 9 Mar 2011 10:58:43 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 34050 invoked by uid 500); 9 Mar 2011 10:58:43 -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 34041 invoked by uid 99); 9 Mar 2011 10:58:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 10:58:43 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,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 gary.tully@gmail.com designates 209.85.216.171 as permitted sender) Received: from [209.85.216.171] (HELO mail-qy0-f171.google.com) (209.85.216.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Mar 2011 10:58:39 +0000 Received: by qyj19 with SMTP id 19so3952893qyj.2 for ; Wed, 09 Mar 2011 02:58:18 -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:content-type:content-transfer-encoding; bh=gEsV0sohLYkgu7kmNIZnIGWjgoK3NTils12xU9pR7fY=; b=d43+If6Cr3fZTAPIhFHReljGDUQkZMoJGa6eyBLctDa9zM0VlkKpHdwStoJBxaDKaU 1K1h0saW8LTatMbRyedkjhhd2veXxD8lQQbmT58/dVgtibRM6uhlsxI7dLs0YqNnuxeS Nz6gwpg3k01unryb3+Ug63kky1iHffY1DdLtI= 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:content-transfer-encoding; b=N0ak+yF0TOgTc7kHZEbBgDQipyi+T6mgcBaT5zj7LxGgOY2H9uXSwxWDDZotXifb7v UWsMYx6kDohh5gzVKA16nFnTgcHQ3aXTl5MYqtPNVxSujA5ZjN3zP8yKWW8ocaOTdv5n C/75EZagg3l450FogdyhW1OJj7MsFLt1x1/pQ= MIME-Version: 1.0 Received: by 10.229.214.204 with SMTP id hb12mr4878670qcb.261.1299668295896; Wed, 09 Mar 2011 02:58:15 -0800 (PST) Received: by 10.229.226.207 with HTTP; Wed, 9 Mar 2011 02:58:15 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Mar 2011 10:58:15 +0000 Message-ID: Subject: Re: Message Cursors and Dispatch From: Gary Tully To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable you are using a durable subscriber but with non persistent messages. Because a non persistent message is not in the brokers messages store, it needs to be locally persisted by the durable subscription cursor, so it uses the filebased message cursor and replays the messages to that. I think what you need is to have non persistent messages use a store based cursor that is backed by your recovery kahadb instance. You would need to extend the StoreDurableSubscriberCursor to implement that (set nonPersistent) and provide a custom PendingDurableSubscriberMessageStoragePolicy to have it used a runtime. Is there a good reason you don't use persistent messages such that a durable topic subscriber can work with the brokers store. On 8 March 2011 18:40, Anirudha Khanna wrote: > I haven't explicitly configured any cursors on the Topic. From the docume= ntation it seems like the default is the store based cursor, but when looki= ng at the ActiveMQ Transport thread stack trace I noticed it was also using= the "FilePendingMessageCursor". Can I explicitly configure the broker to o= nly use the Store based cursor? > > attaching a part of the stack trace, > org.apache.activemq.broker.region.cursors.FilePendingMessageCursor.addMes= sageLast(FilePendingMessageCursor.java:205) > =A0 - locked org.apache.activemq.broker.region.cursors.FilePendingMessage= Cursor@56e48687 > org.apache.activemq.broker.region.cursors.StoreDurableSubscriberCursor.ad= dRecoveredMessage(StoreDurableSubscriberCursor.java:183) > =A0 - locked org.apache.activemq.broker.region.cursors.StoreDurableSubscr= iberCursor@3e539fc > org.apache.activemq.broker.region.DurableTopicSubscription.doAddRecovered= Message(DurableTopicSubscription.java:204) > =A0 - locked org.apache.activemq.broker.region.cursors.StoreDurableSubscr= iberCursor@3e539fc > org.apache.activemq.broker.region.AbstractSubscription.addRecoveredMessag= e(AbstractSubscription.java:174) > com.yahoo.servinggrid.streaming.replay.ReplaySubscriptionRecoveryPolicy$1= .recoverMessage(ReplaySubscriptionRecoveryPolicy.java:224) > org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore$4.ex= ecute(KahaDBStore.java:402) > org.apache.kahadb.page.Transaction.execute(Transaction.java:728) > org.apache.activemq.store.kahadb.KahaDBStore$KahaDBTopicMessageStore.reco= verSubscription(KahaDBStore.java:394) > =A0 - locked java.lang.Object@4edc024a > com.yahoo.servinggrid.streaming.replay.ReplaySubscriptionRecoveryPolicy.r= ecover(ReplaySubscriptionRecoveryPolicy.java:214) > > My broker.xml > > > =A0 =A0 =A0 =A0 =A0 =A0useJmx=3D"true" persistent=3D"true" useShutdownHook=3D"fal= se"> > =A0 =A0 =A0 =A0 =A0 =A0 > > =A0 =A0 =A0 =A0 > > =A0 > =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0"> > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0${activemq.base}/data/re= play-kahadb > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A05000 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 > =A0 > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0enableIndexWriteAsync=3D"true" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0indexCacheSize=3D"5000" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cleanupInterval=3D"900000" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0checkpointInterval=3D"300000"/> > =A0 =A0 > =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 > =A0 > > > > Thanks, > Anirudha > > On 3/8/11 4:34 AM, "Gary Tully" wrote: > > That is expected for the file based cursor. It tries to proxy the > store, so the entire store is replayed through the cursor to ensure > correct message order. This behavoour only makes sense if the > underlying store is very slow, which in your case, kahaDB, is not. > > The store based cursor will be a better match a it does not attempt to > proxy the whole store, rather it reads it in batches and only starts > to cursor new messages in memory when the store is exhausted. > > On 8 March 2011 02:06, Anirudha Khanna wrote: >> Hi, >> >> So I added a custom subscription recovery policy to ActiveMQ-5.3.2 that = stores messages in a different instance of Kaha Db. To load test this recov= ery policy we sent close to ~ 82 million messages(24 hours worth of message= s) to the topic that has the recovery policy enabled on it. >> When connecting a single consumer after broker restart, I noticed that t= he consumer takes a long time to even start getting the messages. Looking a= t the stack trace it seems that ActiveMQ first attempts to add all the reco= vered messages to a Message Cursor(in this case a File Message cursor) and = only then start the dispatch(the dispatch thread is WAITING). Before restar= ting the broker a single consumer was able to receive messages fairly quick= ly. >> Is this the expected behaviour for ActiveMQ, that ALL messages will firs= t be added to the Message cursor before they are dispatched? Is there a way= to get around this? >> >> Thanks, >> Anirudha >> >> > > > > -- > http://blog.garytully.com > http://fusesource.com > > --=20 http://blog.garytully.com http://fusesource.com