Quantcast

ActiveMQ 5.4.14 durable topic since start up

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ActiveMQ 5.4.14 durable topic since start up

vladimiri
Hello, just want to ask for advice on durable subscriptions.

Here is the case:
I do have a lot of message producers for a topic and I want the topic to be persistent and durable. But the problem in that all messages sent to topic _before_ first durable consumer starts is treated as non-persistent and non-durable and will get lost after broker restart.

I tried to configure destinations in broker.xml but it seems It's not the right place.

I want topic to be durable/persistent before any subscriber starts.

Thank you for your help.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ActiveMQ 5.4.14 durable topic since start up

Tim Bain
To the best of my knowledge, it's not possible in ActiveMQ to guarantee
that the broker will deliver all messages in a topic including the ones
before the first consumer joins the topic.  Unlike some other message
brokers such as Kafka and Kinesis, ActiveMQ's design is to delete messages
once they have been consumed by all consumers, which means that there's
generally no reason to keep messages when there are no consumers, nor even
to keep messages that have been delivered to all the current consumers.

With that said, it might be possible to do what you want using a
combination of a subscription recovery policy
<http://activemq.apache.org/subscription-recovery-policy.html> and retroactive
consumers <http://activemq.apache.org/retroactive-consumer.html>, but I've
never used either one so you'd have to try them to see whether they
actually created the behavior you're looking for.

If you have a finite, well-known list of durable consumers on the topic, it
might be possible to script the creation of the durable subscriptions (i.e.
connect and then immediately disconnect using the client ID that each
consumer will be using) immediately after broker startup (for example, by
tying into the activemq start/restart script), but that only works if you
know which subscriptions to create.

Tim

On Apr 14, 2017 2:34 PM, "vladimiri" <[hidden email]> wrote:

Hello, just want to ask for advice on durable subscriptions.

Here is the case:
I do have a lot of message producers for a topic and I want the topic to be
persistent and durable. But the problem in that all messages sent to topic
_before_ first durable consumer starts is treated as non-persistent and
non-durable and will get lost after broker restart.

I tried to configure destinations in broker.xml but it seems It's not the
right place.

I want topic to be durable/persistent before any subscriber starts.

Thank you for your help.



--
View this message in context: http://activemq.2283324.n4.nab
ble.com/ActiveMQ-5-4-14-durable-topic-since-start-up-tp4724963.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ActiveMQ 5.4.14 durable topic since start up

vladimiri
Thank you very much.
In this case I think I just need another tool to handle this or change the initial requirements.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ActiveMQ 5.4.14 durable topic since start up

Tim Bain
If you have to look at another messaging product, Kafka might meet your
needs. It has far fewer features than ActiveMQ, and there are a few
drawbacks to it (such as the inability to do competing consumers), but it
might meet your needs.

Good luck!
Tim

On Apr 18, 2017 5:40 AM, "vladimiri" <[hidden email]> wrote:

> Thank you very much.
> In this case I think I just need another tool to handle this or change the
> initial requirements.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.
> nabble.com/ActiveMQ-5-4-14-durable-topic-since-start-up-
> tp4724963p4725028.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Loading...