You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jlindwall <jl...@yahoo.com> on 2014/02/07 22:25:13 UTC
Runaway producer: Proper way to clean up a topic?
In a previous post I described a problem that occurred in a jdbc-backed 5.9.0
broker with a durable subscriber. The producers got way ahead of the
consumer (which disconnected though did not unsubscribe). I had to restart
activemq as it was hung.
The messages in the topic had a 30 sec expiration so they were all well
expired by then.
I had hoped that when I restarted the broker it would clear out the
ACTIVEMQ_MSGS table, as all the records were expired. Nope.
However, an activemq timer thread slowly started cleaning up the records, 1
per second. At that rate it was going to take 87 hours to clean them all
out!
I then used the console to destroy the durable subscription, thinking that
would accelerate the process. Nope. In fact the 1 second timer ceased
functioning.
At this point I deleted the records by hand using SQL.
What did I do wrong? What would be the correct way to clear out the topic
in the event of such a scenario?
Thanks
John
--
View this message in context: http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Runaway producer: Proper way to clean up a topic?
Posted by jlindwall <jl...@yahoo.com>.
Thanks for the advice. I do not really want to blindly delete all messages at
startup, though; just the expired ones.
--
View this message in context: http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644p4677672.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Runaway producer: Proper way to clean up a topic?
Posted by artnaseef <ar...@artnaseef.com>.
Sounds like a very interesting usecase. A network of brokers might help -
depending on more of the specifics; for example, depending on the cause of
lost connection to the broker, the amount of time for the client to
reconnect can vary. I can think of other approaches to achieve what you've
described, but I would need more information to gauge feasibility.
For example, it would be possible to use redundancy from end-to-end, sending
every message twice across two separate message busses. Then, if one bus
goes down, the other carries the traffic.
--
View this message in context: http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644p4677676.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Runaway producer: Proper way to clean up a topic?
Posted by jlindwall <jl...@yahoo.com>.
I have not reproduced the issue that I regionally experienced sadly. If I
do, I will attempt to capture it in a unit test as you suggest.
Interesting pont about the short timeout; if we indeed need such a short
timeout then persistence is pointless indeed.
My requirements are atypical it seems: small message with a short
shelf-like; if a broker goes down then ideally some mechanism kicks in
quickly (i.e. in seconds, not minutes) to deliver the message. The speed of
kahadb makes me hopeful that persistent messages will work for us; but the
master/slave failover does not provide the lightning fast recovery that we
want.
Could a network of brokers help in this scenario?
THANKS!
--
View this message in context: http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644p4677673.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Runaway producer: Proper way to clean up a topic?
Posted by artnaseef <ar...@artnaseef.com>.
Perhaps persistence isn't needed for those messages at all. 30 seconds is bordering on too fast to restart a broker in many cases.
With that said, it sounds like there may be at least one bug here. If a junit case can be written to prove this case, that would help a lot. Alternatively, a minimal client that demonstrates the problem would help.
Sent from my iPhone
> On Feb 7, 2014, at 7:04 PM, "kimmking [via ActiveMQ]" <ml...@n4.nabble.com> wrote:
>
>
> Use deleteAllMessagesOnStartup option:
> https://activemq.apache.org/broker-uri.html
>
>
> From: [hidden email]
> Date: 2014-02-08 05:26
> To: [hidden email]
> Subject: Runaway producer: Proper way to clean up a topic?
> In a previous post I described a problem that occurred in a jdbc-backed 5.9.0 broker with a durable subscriber. The producers got way ahead of the consumer (which disconnected though did not unsubscribe). I had to restart activemq as it was hung.
>
> The messages in the topic had a 30 sec expiration so they were all well expired by then.
>
> I had hoped that when I restarted the broker it would clear out the ACTIVEMQ_MSGS table, as all the records were expired. Nope.
>
> However, an activemq timer thread slowly started cleaning up the records, 1 per second. At that rate it was going to take 87 hours to clean them all out!
>
> I then used the console to destroy the durable subscription, thinking that would accelerate the process. Nope. In fact the 1 second timer ceased functioning.
>
> At this point I deleted the records by hand using SQL.
>
> What did I do wrong? What would be the correct way to clear out the topic in the event of such a scenario?
>
> Thanks
> John
>
>
>
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644.html
> To unsubscribe from ActiveMQ - User, click here.
> NAML
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644p4677654.html
> To start a new topic under ActiveMQ - User, email ml-node+s2283324n2341805h3@n4.nabble.com
> To unsubscribe from ActiveMQ - User, click here.
> NAML
--
View this message in context: http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644p4677655.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Runaway producer: Proper way to clean up a topic?
Posted by kimmking <ki...@gmail.com>.
Use deleteAllMessagesOnStartup option:
https://activemq.apache.org/broker-uri.html
From: jlindwall [via ActiveMQ]
Date: 2014-02-08 05:26
To: kimmking
Subject: Runaway producer: Proper way to clean up a topic?
In a previous post I described a problem that occurred in a jdbc-backed 5.9.0 broker with a durable subscriber. The producers got way ahead of the consumer (which disconnected though did not unsubscribe). I had to restart activemq as it was hung.
The messages in the topic had a 30 sec expiration so they were all well expired by then.
I had hoped that when I restarted the broker it would clear out the ACTIVEMQ_MSGS table, as all the records were expired. Nope.
However, an activemq timer thread slowly started cleaning up the records, 1 per second. At that rate it was going to take 87 hours to clean them all out!
I then used the console to destroy the durable subscription, thinking that would accelerate the process. Nope. In fact the 1 second timer ceased functioning.
At this point I deleted the records by hand using SQL.
What did I do wrong? What would be the correct way to clear out the topic in the event of such a scenario?
Thanks
John
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644.html
To unsubscribe from ActiveMQ - User, click here.
NAML
--
View this message in context: http://activemq.2283324.n4.nabble.com/Runaway-producer-Proper-way-to-clean-up-a-topic-tp4677644p4677654.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.