You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Qian Su <qs...@linkedin.com> on 2008/02/29 04:10:11 UTC

retry without using Failover Transport

Hi,

We are using Activemq version 4.1.1, tcp transport and we'd like the
producer to retry at least once in case of connection timeout to a broker.
The brokers are configured behind a load balancer.

Does Activemq support retries on the producer end? 

I am aware of the FailoverTransport and knows it provides configuration for
maxReconnectAttempts, initialReconnectDelay, etc, but am not sure if this is
the best approach or if it is applicable for our situation since the load
balancer is the only one point of entry to talk to a broker in our case.

Is it correct to configure a producer connection URL to the load balancer
something like this:

failover://(tcp://host:61616)?maxReconnectAttempts=1&initialReconnectDelay=200

By the way, I tried the above URL and id doesn't seem to work.

Any direction would be helpful.
Thanks,
Qian

-- 
View this message in context: http://www.nabble.com/retry-without-using-Failover-Transport-tp15751188s2354p15751188.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: retry without using Failover Transport

Posted by Rob Davies <ra...@gmail.com>.
On 29 Feb 2008, at 03:10, Qian Su wrote:

>
> Hi,
>
> We are using Activemq version 4.1.1, tcp transport and we'd like the
> producer to retry at least once in case of connection timeout to a  
> broker.
> The brokers are configured behind a load balancer.
>
> Does Activemq support retries on the producer end?
>
> I am aware of the FailoverTransport and knows it provides  
> configuration for
> maxReconnectAttempts, initialReconnectDelay, etc, but am not sure if  
> this is
> the best approach or if it is applicable for our situation since the  
> load
> balancer is the only one point of entry to talk to a broker in our  
> case.
>
> Is it correct to configure a producer connection URL to the load  
> balancer
> something like this:
>
> failover://(tcp://host:61616)? 
> maxReconnectAttempts=1&initialReconnectDelay=200
>
That should work!
> By the way, I tried the above URL and id doesn't seem to work.
>
Maybe try a bigger initialReconnectDelay ?

> Any direction would be helpful.
> Thanks,
> Qian
>
> -- 
> View this message in context: http://www.nabble.com/retry-without-using-Failover-Transport-tp15751188s2354p15751188.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>




cheers,

Rob

http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/




Re: retry without using Failover Transport

Posted by Qian Su <qs...@linkedin.com>.
Hi,

Yes indeed, the initialReconnectDelay doesn't seem to have effect at all,
the producer is reconnecting immediately regardless of the value specified. 
Do you happen to know why?

Thanks,
Qian
 

Adrian Co wrote:
> 
> Hi,
> 
> The initialReconnectDelay is the delay for the first attempt only. Is it 
> reconnecting immediately on the first try?
> 
> Use the maxReconnectDelay to specify the delay for succeeding attempts.
> http://activemq.apache.org/failover-transport-reference.html
> 
> Regards,
> Adrian Co
> 
> Qian Su wrote:
>> Hi,
>>
>> Thanks for the reply. I do see retry attempts from FailoverTransport in
>> the
>> stacktrace now, however the initialReconnectDelay param doesn't seem to
>> have
>> effect.
>>
>> I applied the following producer URL to broker and it seems that the 2
>> retries are attempted immediately.
>>  
>> failover://(tcp://localhost:61616)?maxReconnectAttempts=2&amp;initialReconnectDelay=10000
>>
>> Is this the correct way to set initial reconnect delay?
>> Thanks,
>> Qian
>>
>> On 29/02/2008, Qian Su <qs...@linkedin.com> wrote:
>>   
>>>  Hi,
>>>
>>>  We are using Activemq version 4.1.1, tcp transport and we'd like the
>>>  producer to retry at least once in case of connection timeout to a
>>> broker.
>>>  The brokers are configured behind a load balancer.
>>>
>>>  Does Activemq support retries on the producer end?
>>>     
>>
>> Yes -using failover transport
>>
>>   
>>>  I am aware of the FailoverTransport and knows it provides configuration
>>> for
>>>  maxReconnectAttempts, initialReconnectDelay, etc, but am not sure if
>>> this
>>> is
>>>  the best approach or if it is applicable for our situation since the
>>> load
>>>  balancer is the only one point of entry to talk to a broker in our
>>> case.
>>>     
>>
>> It is. You can define how many times you want the client to attempt to
>> reconnect - irrespective of how host names are mapped to physical real
>> IP addresses.
>>
>> e.g. use failover with a single logical hostname/IP adress.
>>
>>
>>   
>>>  Is it correct to configure a producer connection URL to the load
>>> balancer
>>>  something like this:
>>>
>>>
>>> failover://(tcp://host:61616)?maxReconnectAttempts=1&initialReconnectDelay=200
>>>
>>>  By the way, I tried the above URL and id doesn't seem to work.
>>>     
>>
>>
>> Does increasing the maxReconnectAttempts help?
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/retry-without-using-Failover-Transport-tp15751188s2354p15975080.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: retry without using Failover Transport

Posted by Adrian Co <ac...@exist.com>.
Hi,

The initialReconnectDelay is the delay for the first attempt only. Is it 
reconnecting immediately on the first try?

Use the maxReconnectDelay to specify the delay for succeeding attempts.
http://activemq.apache.org/failover-transport-reference.html

Regards,
Adrian Co

Qian Su wrote:
> Hi,
>
> Thanks for the reply. I do see retry attempts from FailoverTransport in the
> stacktrace now, however the initialReconnectDelay param doesn't seem to have
> effect.
>
> I applied the following producer URL to broker and it seems that the 2
> retries are attempted immediately.
>  
> failover://(tcp://localhost:61616)?maxReconnectAttempts=2&amp;initialReconnectDelay=10000
>
> Is this the correct way to set initial reconnect delay?
> Thanks,
> Qian
>
> On 29/02/2008, Qian Su <qs...@linkedin.com> wrote:
>   
>>  Hi,
>>
>>  We are using Activemq version 4.1.1, tcp transport and we'd like the
>>  producer to retry at least once in case of connection timeout to a
>> broker.
>>  The brokers are configured behind a load balancer.
>>
>>  Does Activemq support retries on the producer end?
>>     
>
> Yes -using failover transport
>
>   
>>  I am aware of the FailoverTransport and knows it provides configuration
>> for
>>  maxReconnectAttempts, initialReconnectDelay, etc, but am not sure if this
>> is
>>  the best approach or if it is applicable for our situation since the load
>>  balancer is the only one point of entry to talk to a broker in our case.
>>     
>
> It is. You can define how many times you want the client to attempt to
> reconnect - irrespective of how host names are mapped to physical real
> IP addresses.
>
> e.g. use failover with a single logical hostname/IP adress.
>
>
>   
>>  Is it correct to configure a producer connection URL to the load balancer
>>  something like this:
>>
>>
>> failover://(tcp://host:61616)?maxReconnectAttempts=1&initialReconnectDelay=200
>>
>>  By the way, I tried the above URL and id doesn't seem to work.
>>     
>
>
> Does increasing the maxReconnectAttempts help?
>
>   


Re: retry without using Failover Transport

Posted by Qian Su <qs...@linkedin.com>.
Hi,

Thanks for the reply. I do see retry attempts from FailoverTransport in the
stacktrace now, however the initialReconnectDelay param doesn't seem to have
effect.

I applied the following producer URL to broker and it seems that the 2
retries are attempted immediately.
 
failover://(tcp://localhost:61616)?maxReconnectAttempts=2&amp;initialReconnectDelay=10000

Is this the correct way to set initial reconnect delay?
Thanks,
Qian

On 29/02/2008, Qian Su <qs...@linkedin.com> wrote:
>
>  Hi,
>
>  We are using Activemq version 4.1.1, tcp transport and we'd like the
>  producer to retry at least once in case of connection timeout to a
> broker.
>  The brokers are configured behind a load balancer.
>
>  Does Activemq support retries on the producer end?

Yes -using failover transport

>  I am aware of the FailoverTransport and knows it provides configuration
> for
>  maxReconnectAttempts, initialReconnectDelay, etc, but am not sure if this
> is
>  the best approach or if it is applicable for our situation since the load
>  balancer is the only one point of entry to talk to a broker in our case.

It is. You can define how many times you want the client to attempt to
reconnect - irrespective of how host names are mapped to physical real
IP addresses.

e.g. use failover with a single logical hostname/IP adress.


>  Is it correct to configure a producer connection URL to the load balancer
>  something like this:
>
> 
> failover://(tcp://host:61616)?maxReconnectAttempts=1&initialReconnectDelay=200
>
>  By the way, I tried the above URL and id doesn't seem to work.


Does increasing the maxReconnectAttempts help?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com



-- 
View this message in context: http://www.nabble.com/retry-without-using-Failover-Transport-tp15751188s2354p15837799.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: retry without using Failover Transport

Posted by James Strachan <ja...@gmail.com>.
On 29/02/2008, Qian Su <qs...@linkedin.com> wrote:
>
>  Hi,
>
>  We are using Activemq version 4.1.1, tcp transport and we'd like the
>  producer to retry at least once in case of connection timeout to a broker.
>  The brokers are configured behind a load balancer.
>
>  Does Activemq support retries on the producer end?

Yes -using failover transport

>  I am aware of the FailoverTransport and knows it provides configuration for
>  maxReconnectAttempts, initialReconnectDelay, etc, but am not sure if this is
>  the best approach or if it is applicable for our situation since the load
>  balancer is the only one point of entry to talk to a broker in our case.

It is. You can define how many times you want the client to attempt to
reconnect - irrespective of how host names are mapped to physical real
IP addresses.

e.g. use failover with a single logical hostname/IP adress.


>  Is it correct to configure a producer connection URL to the load balancer
>  something like this:
>
>  failover://(tcp://host:61616)?maxReconnectAttempts=1&initialReconnectDelay=200
>
>  By the way, I tried the above URL and id doesn't seem to work.


Does increasing the maxReconnectAttempts help?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com