activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Rosenberg <jrosenb...@shopzilla.com>
Subject Re: Timeout and Failover on a queue
Date Mon, 26 Nov 2007 20:34:00 GMT

I'm curious whether you've found a solution to this.  I've seen also that if
you use the maxReconnectAttempts, and it fails to reconnect, then the
connection cannot be reliably recovered.

I've tried it with the Jencks AMQPool for my connection pooling, as well as
the standard ActiveMQ PooledConnections....

And if you don't use the maxReconnectAttempts flag, then it retries forever,
and hangs the client.

So, I'd be interested to know if there's a way to have it recover cleanly on
failure, but always return quickly to the client if all failover choices
have failed....

Jason



delphz wrote:
> 
> I have a queueSession that is a singleton for my application on server A.
> This queueSession is set at startup. When I start up my application,
> activemq is up : my application can send messages. I stop activemq : the
> messages are dropped. But when I restart activemq, my application can't
> send messages. I tried to do a recover but it doesn't work.
> 
> 
> 
> Eduardo Corral wrote:
>> 
>> Yep, that's the normal behavior.
>> 
>> The A servers are probably failing to connect before the B brokers are 
>> started. With the parameters you set, and starting A servers before B 
>> brokers, it's bound to fail...
>> 
>> Try increasing  maxReconnectAttempts and maxReconnectDelay parameters, 
>> so there's enough time to B brokers to start before A servers give up 
>> trying.
>> 
>> BTW, which is the behaviour you're looking for? Infinite retries? 
>> Inmediate fail in case both B brokers are down?
>> 
>> Regards
>> Eduardo Corral
>> 
>> delphz escribió:
>>> OK, it was my mistake, i set a boolean to late...
>>>
>>> Now, I have the following configuration :
>>> failover://(tcp://B1:61616,tcp://B2:62626)?maxReconnectAttempts=1&maxReconnectDelay=100
>>>
>>> But when I restart my activemq server, my A servers cannot reconnect to
>>> it.
>>> When I send a message, I have : javax.jms.JMSException: Connection
>>> refused.
>>>
>>> Have you got an idea ?
>>>
>>>
>>> delphz wrote:
>>>   
>>>> I set the maxReconnectAttempts to 1 and it is trying to reconnect
>>>> endlessly. And it can't connect to the B servers, even if they are up.
>>>>
>>>>
>>>> Eduardo Corral wrote:
>>>>     
>>>>> Hi Delphine
>>>>>
>>>>> Have you checked the log files? Maybe the clients (A1, A2,...) do
>>>>> follow 
>>>>> the timeout parameter, but they are trying to reconnect endlessly...
>>>>>
>>>>> http://activemq.apache.org/failover-transport-reference.html
>>>>>
>>>>> With failover, you may also configure how long between retries and how

>>>>> many of them.
>>>>>
>>>>> Best regards,
>>>>> Eduardo Corral
>>>>>
>>>>> delphz escribió:
>>>>>       
>>>>>> Hello,
>>>>>>
>>>>>> I have some servers A1, A2, AN, ... that send messages on a queue
on
>>>>>> servers
>>>>>> B1 ans B2. I configured my A servers to connect with the following
>>>>>> URI :
>>>>>> failover:(tcp://B1:61616,tcpB2:62626). But when activemq is stopped
>>>>>> on
>>>>>> both
>>>>>> B1 and B2, my servers A wait a long time before deciding that B1
and
>>>>>> B2
>>>>>> are
>>>>>> down. So I test to add a timeout.
>>>>>>
>>>>>> If I configure my A servers with :
>>>>>> tcp://B1:61616?connectionTimeout=1000, I
>>>>>> have no problem. But if I configured with the following :
>>>>>> failover:(tcp://B1:61616?connectionTimeout=1000,tcp://B2:62626?connectionTimeout=1000),
>>>>>> it doesn't work. I tried lot of things :
>>>>>> - set connectionTimeout after the ) :
>>>>>> failover:(B1,B2)?connectionTimeout=1000
>>>>>> - set closeTimeout on my ConnectionFactory
>>>>>> - set wireFormat.maxInactivityDuration
>>>>>> - ...
>>>>>>
>>>>>> I can't get it work.
>>>>>>
>>>>>> Could you tell me how to configure it ?
>>>>>>
>>>>>> Thanks !!
>>>>>>
>>>>>> Delphine
>>>>>>   
>>>>>>         
>>>>>       
>>>>     
>>>
>>>   
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Timeout-and-Failover-on-a-queue-tf4652630s2354.html#a13958172
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message