activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Davies <rajdav...@gmail.com>
Subject Re: Persisting messages across restarts (AMQ 4.1.1 & 4.1.2)
Date Wed, 23 Apr 2008 06:12:30 GMT

On 23 Apr 2008, at 00:27, deepak.kumar wrote:

>
> Hi Folks,
>    I'm hoping this is an easy one to answer for some of you.
>
>    Been using AMQ 4.1.1 for a couple of months now, and only just  
> noticed
> that messages on topics with durable subscriptions were not being  
> persisted
> across restarts, which seems like a bit of problem :confused:. At a  
> high
> level, here are the steps I follow:
>
> - Disable all consumers
> - Put a few messages on topic
> - Verify topic size is non zero using JMX
> - Restart AMQ
> - Notice topic size is zero again.
>
>    The message producer definitely sets the
> javax.jms.DeliveryMode#PERSISTENT flag (we use Spring's  
> JmsTemplate), and
> the broker is configured as follows :
>
> <broker useJmx="true" xmlns="http://activemq.org/config/1.0"
> brokerName="localhost"
>    dataDirectory="${activemq.home}/activemq-data/"
>>
>
> [[SNIP]]
>
>   <persistenceAdapter>
>      <journaledJDBC journalLogFiles="5"
> dataDirectory="${activemq.home}/activemq-data/journaledJDBC"/>
>    </persistenceAdapter>
>
> [[SNIP]]
>
> </broker>
>
> I've also tried several combinations of the following :
> - AMQ Versions 4.1.1, 4.1.2 & 5.0.0
> - PersistenceAdapter kaha & journaledJDBC for the 4.1.x and
> amqPersistenceAdapter for 5.0.0
> - Within the journaledJDBC, 2 different data sources, mysql & derby
> embedded.
> - Set  persistent="true" on the <broker>
>
> What am I missing? I've spent the better part of today scouring the  
> internet
> for leads, and reading through documentation with little success. If  
> someone
> could right this ship, I'd really appreciate it.
>
> I guess more specifically, the questions I've been unable to answer:
> - Is AMQ capable of preserving messages across restarts?
> - Is AMQ capable of preserving messages across restarts using an  
> embedded
> derby instance?
> - And the golden ticket : does anybody have configuration they can  
> share to
> make it so ? :-D
>
> Regards,
> Deepak.
>
> -- 
> View this message in context: http://www.nabble.com/Persisting-messages-across-restarts-%28AMQ-4.1.1---4.1.2%29-tp16827035s2354p16827035.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Hi Deepak,

you might have run into a common gotcha with durable topic  
subscriptions - there is a faq - http://activemq.apache.org/why-do-i-not-receive-messages-on-my-durable-topic-subscription.html
which actually needs fleshing out a bit - but I wonder if you are  
creating your durable topic subscriptions before you send you messages ?

Persistentence works differently between queues and topics - with  
queues messages are always persisted - but with topics - messages are  
only persisted across broker re-starts if there exits a durable  
subscription (it does have to be running - just to have registered an  
interest - i.e. started - then stopped).

This is one reason why virtual topics are handy - see http://activemq.apache.org/virtual-destinations.html
or you could use JMX to create a a durable subscriber - its an  
operation on the BrokerViewMBean




cheers,

Rob

http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/




Mime
View raw message