You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by agatone <zo...@gmail.com> on 2009/04/28 12:55:00 UTC
Reconnect of the durable consumers after ActiveMQ restart/fail
Hi,
I have this setup where I set few durable consumers (setMessageListener) and
they succesfully register on ActiveMQ. But as soon as the ActiveMQ shutdowns
(by whatever the cause is) and is later restarted all the previous registred
consumers are left hanging somwhere and are not visible as registred in the
ActiveMQ administration.
How can all the consumers that were registred before the ActiveMQ failure
and then restart be registred again?
My MQ connection string is :
failover:(tcp://localhost:61616)?maxReconnectAttempts=2, but this doesn't
help revive those consumers.
Thank you.
--
View this message in context: http://www.nabble.com/Reconnect-of-the-durable-consumers-after-ActiveMQ-restart-fail-tp23274688p23274688.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Reconnect of the durable consumers after ActiveMQ restart/fail
Posted by agatone <zo...@gmail.com>.
I guess i'll try using two different URIs
producers One with maxReconnectAttempts=2 - this will not block my producer
consumers one with default value of maxRecconecetAttempts - which is -1
cuz i want my consumers to keep trying reconnect forever - since they don't
block anyone.
Thank you for your help.
Diego RodrÃguez wrote:
>
> Hi,
>
> I have a similar config. I think the problem is because you have
> maxReconnectAttempts parameter set to 2. When the connection reaches max
> attempts it does not try to connect again, which is logicall. If you want
> to revive your consumers you will have to reinstall them. At least is what
> I have to do for consumers using ActiveMQConnectionFactory. Por producers
> using PooledConnectionFactory, they get a new connection from pool. I
> don't know if ActiveMQConnectionFactory is intended to work that way
>
> The problem is that if you don't set maxReconnectAttempts, if the
> broker shutdowns, trying to reconnect is blocking, and for example in my
> case this can lead to exhaust tomcat thread pool because threads waits for
> connection to be avalaible. I would rather prefer setting a timeout trying
> to connect so the calls are not blocking, and try to reconnect forever but
> this won't be available until 5.3 release, I think
>
> Diego
>
--
View this message in context: http://www.nabble.com/Reconnect-of-the-durable-consumers-after-ActiveMQ-restart-fail-tp23274688p23295556.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Reconnect of the durable consumers after ActiveMQ restart/fail
Posted by Diego RodrÃguez <dr...@altiria.com>.
Hi,
I have a similar config. I think the problem is because you have
maxReconnectAttempts parameter set to 2. When the connection reaches max
attempts it does not try to connect again, which is logicall. If you want to
revive your consumers you will have to reinstall them. At least is what I
have to do for consumers using ActiveMQConnectionFactory. Por producers
using PooledConnectionFactory, they get a new connection from pool. I don't
know if ActiveMQConnectionFactory is intended to work that way
The problem is that if you don't set maxReconnectAttempts, if the broker
shutdowns, trying to reconnect is blocking, and for example in my case this
can lead to exhaust tomcat thread pool because threads waits for connection
to be avalaible. I would rather prefer setting a timeout trying to connect
so the calls are not blocking, and try to reconnect forever but this won't
be available until 5.3 release, I think
Diego
--
View this message in context: http://www.nabble.com/Reconnect-of-the-durable-consumers-after-ActiveMQ-restart-fail-tp23274688p23295262.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Reconnect of the durable consumers after ActiveMQ restart/fail
Posted by agatone <zo...@gmail.com>.
So , am I doing something wrong and nobody has this problem or it might be
that nobody noticed it yet :)
agatone wrote:
>
> Hi,
>
> I have this setup where I set few durable consumers (setMessageListener)
> and they succesfully register on ActiveMQ. But as soon as the ActiveMQ
> shutdowns (by whatever the cause is) and is later restarted all the
> previous registred consumers are left hanging somwhere and are not visible
> as registred in the ActiveMQ administration.
>
> How can all the consumers that were registred before the ActiveMQ failure
> and then restart be registred again?
>
> My MQ connection string is :
> failover:(tcp://localhost:61616)?maxReconnectAttempts=2, but this doesn't
> help revive those consumers.
>
> Thank you.
>
--
View this message in context: http://www.nabble.com/Reconnect-of-the-durable-consumers-after-ActiveMQ-restart-fail-tp23274688p23294891.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.