activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramit Arora <>
Subject Consuming persistent messages from a non-durable subscriber
Date Fri, 28 Mar 2008 09:42:56 GMT

Hi All,
I have a situation where I have to consume persisent messages from many
non-durable subscribers. My publishers push persistent messages to a topic,
which are consumed asynchronously by non-durable subscribers. I am using the
AMQ Persistence Adapter & CLIENT_ACKNOWLEDGE. If I kill a non-durable
subscriber & bring it up again, some messages are lost, which is expected.
But consider the following case:
1. Start a publisher publishing persistent messages to a topic.
2. Start a non-durable subscriber which is slow compared to the publisher.
3. Kill the broker when 100 messages have been published but only 50 have
been consumed.
4. Since the publisher & subscriber are failover clients, they wait for the
broker to come up again.
5. Restart the broker.
6. Try to get the remaining 50 messages to the non-durable subscriber.

Step 6 does not work in both 5.0 & the latest 5.1 snapshot. Shouldn't the
remaining 50 messages be delivered? The JMS spec says:
"A JMS provider must deliver a PERSISTENT message once-and-only-once. This
means a JMS provider failure must not cause it to be lost, and it must not
deliver it twice. PERSISTENT (once-and-only-once) and NON_PERSISTENT
message delivery are a way for a JMS client to select between delivery
techniques that may lose a messages if a JMS provider dies and those which
take extra effort to insure that messages can survive such a failure. There
typically a performance/reliability trade-off implied by this choice. When a
client selects the NON_PERSISTENT delivery mode, it is indicating that it
values performance over reliability; a selection of PERSISTENT reverses the
requested trade-off."

Queues donot suffer from this problem. Please let me know if I am missing


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message