activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Re: Persistence not working
Date Fri, 19 Feb 2010 23:08:36 GMT
On Fri, Feb 19, 2010 at 3:31 PM, Wxman <Mark.Fenbers@noaa.gov> wrote:
>
>
> bsnyder wrote:
>>
>> The default configuration in ActiveMQ 5.3 will persist messages using
>> KahaDB:
>>
>> http://activemq.apache.org/kahadb.html
>>
>> This will persist messages between broker restarts. But this will only
>> work if the messages are marked for persistence by the message
>> producer:
>>
>> MessageProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
>>
>> Bruce
>>
>
> Yes, KahaDB is indeed what being used (verified by browsing the "data"
> subdir), and I clearly set the delivery mode to DeliveryMode.PERSISTENT in
> all my producer code.  This is why I am perplexed.
>
> However, you mentioned that the persistence feature keeps messages in
> existence between broker restarts.  But my understanding was that the
> messages persist such that when they are handled by activeMQ at 10 o'clock,
> that my app will receive them even if it is launched at 11 o'clock.  Is my
> concept of the purpose of persistence incorrect?
>
> The goal I desire is for my app to receive messages that were generated and
> sent to the ActiveMQ broker even well before my app was even launched.  This
> way, it can "catch up" even when it was launched too late to catch the
> messages "live".  Is this possible?  If so, this feature is not working in
> my current configuration and I need to get to the bottom of what I've done
> wrong.

What you're referring to is not a function of message persistence.
You're confusing message persistence with message durability. What
you're referring to is message durability and is only applicable to
topics. Below is the description of the two that I wrote for chapter 2
of the forthcoming ActiveMQ In Action book:


Two points within JMS that are often confused are message durability
and message persistence. Though they are similar, there are some
semantic differences but each has its specific purpose. Message
durability can only be achieved with the pub/sub domain. When clients
connect to a topic, they can do so using a durable or a non-durable
subscription. Consider the differences between the two:

Durable Subscription - A durable subscription is infinite. It is
registered with the topic to tell the JMS provider to preserve the
subscription state in the event that the subscriber disconnects. If a
durable subscriber disconnects, the JMS provider will hold all
messages until that subscriber connects again.

Non-Durable Subscription - A non-durable subscription is finite. It's
subscription state is not preserved by the JMS provider in the event
that the subscriber disconnects. If a subscriber disconnects, it
misses all messages during the disconnection period and the JMS
provider will not hold them.

Message persistence is independent of the message domain. Message
persistence is a quality of service property used to indicate the JMS
application's ability to handle missing messages in the event of a JMS
provider failure.


Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Mime
View raw message