activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yari Marchetti <>
Subject Re: Durable subscriptions
Date Mon, 29 Sep 2008 08:34:07 GMT
Reading the link you provided, i found that:

"So we support a timed or fixed size recovery buffer so that
if you reconnect to another broker within some time period
(...), then *any messages you missed during the downtime*
are redelivered before new messages are delivered to you."

so i tried this:

1) connect with client id 'test'
2) make a durable subscription 'test-subscription' to
    topic 'test-topic'
3) send a message to 'test-topic'
4) receive the message from 'test-topic' acknowleding it
5) disconnecting
6) reconnect with client id 'test'
7) subscribe to 'test-topic' with 'test-subscription' id and
    specifying, that's a retroactive consumer.
8) receive a message

So since the above statement states that i should be getting
any message *i missed during the downtime*, and there
weren't, i would have expected to receive nothing, and instead
i received the message i received and acknowledged before.
is this ok? is this compliant to what's written in that link?

my concerns are about memory: in my view, messages already
sent and acknowledged, should be discarded and not
retransmitted every time a durable subscriber comes back,
because they are a waste of memory, bandwidth and time.


Bruce Snyder ha scritto:
> On Fri, Sep 26, 2008 at 7:32 AM, Yari Marchetti
> <> wrote:
>> Hi everyone,
>> i was playing with durable subscriptions and observed a
>> behavior that seems strange to me. I configured ActiveMQ
>> with
>> <fixedSizedSubscriptionRecoveryPolicy maximumSize="32768" />
>> for every topic, and then created a durable subscriber for topic
>> "test" with a unique client-id and subscription name. Using a
>> producer i sent 3 messages to the "test" topic and by using web
>> console i was able to see that there were enqueued message for the
>> durable subscription, waiting to be delivered.
>> By using a durable consumer i was able to retrieve all of the 3
>> messages, acking them, and then disconnected the client. I
>> then retried to log on the broker with the same durable
>> subscription and surprising i received those 3 messages again.
>> i tried to look at JMS specifications but nothing it's unspecified. so:
>> Is this the normal behavior? i was expecting to not receive those
>> messages again since i got them, and acknowledged them. shouldn't
>> them be removed from the state when they are correctly delivered?
> What you describe sounds like the correct behavior. Take a look at the
> explanation of subscription recovery policies here:
> Bruce

View raw message