Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 56797 invoked from network); 30 Jul 2006 19:20:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Jul 2006 19:20:19 -0000 Received: (qmail 79763 invoked by uid 500); 30 Jul 2006 19:20:18 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 79739 invoked by uid 500); 30 Jul 2006 19:20:18 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 79730 invoked by uid 99); 30 Jul 2006 19:20:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Jul 2006 12:20:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Jul 2006 12:20:17 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1G7GpR-00058l-1L for activemq-dev@geronimo.apache.org; Sun, 30 Jul 2006 12:19:57 -0700 Message-ID: <5566195.post@talk.nabble.com> Date: Sun, 30 Jul 2006 12:19:57 -0700 (PDT) From: kmh27 To: activemq-dev@geronimo.apache.org Subject: Re: Recovery Policies should apply between broker restart In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-Sender: himmeric@us.ibm.com X-Nabble-From: kmh27 References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thanks for the follow up James. I took a stab at implementing a new custom recovery policy PersistentLastImageSubscriptionRecoveryPolicy. I think I have the logic basically implemented, but have a few implementation questions. I guess the first issue is what components should i be leveraging to take advantadge of the fact I'm wired up internally to ActiveMQ. Currently I'm using a normal connection acquired through ActiveMQConnectionFactory with a uri of vm://brokerName Not sure this is optimal. I'm attempting to use one connection per broker via my own Singleton connection manager. I ended up with a lazy initialization of my recovery policy, since I need the broker name and topic name which are only acquired through the add(), recover() or browse() methods. I think this laziness is desired. So I basically followed the approach you laid out and think I'm close to functional. I do have one critical problem still and that's that my createDurableTopicSubscriber call is blocking and not returning. I suspect this is some kind of synchronization problem. Recall my comment on lazy initialization, so the createDurableSubscriber for the recovery policy is created when an add() or recover() are called either from a producer sending a message or a consumer joining. It looks like the createDurableTopicSubscriber call is blocking which prevents the add() or recover() from completing which then blocks the end publisher (if not async) and/or new consumer. I've noticed if I hard code an alternate topic the durableTopicSubscriber starts up fine, but obviously that won't work b/c the policy will contain the wrong messages. This is why I suspect some synchronization problem between the topic send() or add publisher and the recovery policy startup. I'm attaching my code, please excuse the mess, been chasing my tail in here trying to sort this out. http://www.nabble.com/user-files/157/persist-last.zip persist-last.zip Any ideas? -- View this message in context: http://www.nabble.com/Re%3A-Recovery-Policies-should-apply-between-broker-restart-tf1996384.html#a5566195 Sent from the ActiveMQ - Dev forum at Nabble.com.