activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmh27 <>
Subject Re: Recovery Policies should apply between broker restart
Date Sun, 30 Jul 2006 19:19:57 GMT

Thanks for the follow up James.

I took a stab at implementing a new custom recovery policy

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

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. 


Any ideas?
View this message in context:
Sent from the ActiveMQ - Dev forum at

View raw message