activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "manuele.simi" <manuele.s...@campagnelab.org>
Subject Re: Number of consumers question
Date Wed, 02 Jul 2014 14:03:17 GMT
sks wrote
> I am testing durable topics.
> 
> I'm using the JAVA to programatically create the topic and the durable
> subscriber.
> The test closes the subscriber, session and connection and then exits
> 
> If i use the ActiveMQ web console, it still shows the number of consumers
> at 1.
> I would have expected this to have gone to 0 now that the Java program has
> exited.

That's exactly how durable subscribers work. They are durable, meaning that
they survive to the process that creates them. If you want a subscriber is
removed when it is offline, just do no create a durable one. 


sks wrote
> Then i use another program to send a couple messages to this topic
> The offline subscriber shows enqueue of 2 which is what I expect as they
> are sitting on there.
> This program exits
> 
> Now I run the consumer program again.
> It consumes the two messages as I would expect.
> But if I go back to the admin console for activeMQ (topic screen), it
> still shows consumers as 1, enqueue of 2 and dequeue of 0.
> 
> I don't understand why this dequeue is set to 0 .
> If I look at the subscriber screen, it shows the enqueue/dequeue of 2 as I
> expect.
> 
> Any ideas on this?

I'm not sure about this second question. It seems related to the way the
consumer informs the broker that all messages are now consumed and don't
need to be redelivered. This usually depends on the way you create the
session in the connection at the consumer side., if it is transacted or not,
if you commit or ack it after the consumer receives a message.




--
View this message in context: http://activemq.2283324.n4.nabble.com/Number-of-consumers-question-tp4682575p4682731.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message