You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by nabbleuser2008 <cc...@yahoo.com> on 2008/07/09 21:28:23 UTC

Specifying a timeout value for createTopicConnection() method

Hi, 
Apologize if this has been answered before...

Is there a way to specify a timeout value so that createTopicConnection()
method does not hang when the broker is not reachable (down) ?

Thank you.
-- 
View this message in context: http://www.nabble.com/Specifying-a-timeout-value-for-createTopicConnection%28%29-method-tp18368943p18368943.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying a timeout value for createTopicConnection() method

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
Yes, you can use the following options (default values provided) to control
the failover transport connector. 

initialReconnectDelay = 10;
maxReconnectDelay = 1000 * 30;
backOffMultiplier = 2;
useExponentialBackOff = true;
maxReconnectAttempts; //indefinite reconnect attempts

In this example, the failover will try 5 times to connect to the broker,
then returns control to the client by throwing an exception if it cannot
connect. 

failover://(tcp://localhost:61616)?maxReconnectAttempts=5

Joe

Get a free ActiveMQ user guide @ http://www.ttmsolutions.com




nabbleuser2008 wrote:
> 
> Hi Joe,
> 
> Thank you for your reply. Sorry it took me such a long time to reply. 
> 
> We're using 5.2 version. And, Yes, we use failover transports. Do you
> think the use of failover transport make it hang under this situation ?
> Any suggestions how to avoid it while keeping failover transports ?
> 
> Thank you very much.
> 
> 
> 
> 
> Joe Fernandez wrote:
>> 
>> FWIW, I am using 5.1 and my createTopicConnection doesn't hang; it hurls
>> a ConnectException if the target broker is not running. 
>> 
>> What version of AMQ are you using?
>> 
>> Are you by any chance using failover transports?
>> 
>> Joe
>> www.ttmsolutions.com
>> 
>> 
>> 
>> nabbleuser2008 wrote:
>>> 
>>> I would have told this is a problem others would have run into also. Or,
>>> am I doing something wrong ?
>>> 
>>> In my system, createTopicConnection() call hangs when the broker is not
>>> reachable, for example, when it is down.
>>> 
>>> Appreciate any help.
>>> Thank you.
>>> 
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Specifying-a-timeout-value-for-createTopicConnection%28%29-method-tp18368943p20486733.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying a timeout value for createTopicConnection() method

Posted by nabbleuser2008 <cc...@yahoo.com>.
Hi Joe,

Thank you for your reply. Sorry it took me such a long time to reply. 

We're using 5.2 version. And, Yes, we use failover transports. Do you think
the use of failover transport make it hang under this situation ? Any
suggestions how to avoid it while keeping failover transports ?

Thank you very much.




Joe Fernandez wrote:
> 
> FWIW, I am using 5.1 and my createTopicConnection doesn't hang; it hurls a
> ConnectException if the target broker is not running. 
> 
> What version of AMQ are you using?
> 
> Are you by any chance using failover transports?
> 
> Joe
> www.ttmsolutions.com
> 
> 
> 
> nabbleuser2008 wrote:
>> 
>> I would have told this is a problem others would have run into also. Or,
>> am I doing something wrong ?
>> 
>> In my system, createTopicConnection() call hangs when the broker is not
>> reachable, for example, when it is down.
>> 
>> Appreciate any help.
>> Thank you.
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Specifying-a-timeout-value-for-createTopicConnection%28%29-method-tp18368943p20482050.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying a timeout value for createTopicConnection() method

Posted by Joe Fernandez <jo...@ttmsolutions.com>.
FWIW, I am using 5.1 and my createTopicConnection doesn't hang; it hurls a
ConnectException if the target broker is not running. 

What version of AMQ are you using?

Are you by any chance using failover transports?

Joe
www.ttmsolutions.com



nabbleuser2008 wrote:
> 
> I would have told this is a problem others would have run into also. Or,
> am I doing something wrong ?
> 
> In my system, createTopicConnection() call hangs when the broker is not
> reachable, for example, when it is down.
> 
> Appreciate any help.
> Thank you.
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Specifying-a-timeout-value-for-createTopicConnection%28%29-method-tp18368943p18413111.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Specifying a timeout value for createTopicConnection() method

Posted by nabbleuser2008 <cc...@yahoo.com>.
I would have told this is a problem others would have run into also. Or, am I
doing something wrong ?

In my system, createTopicConnection() call hangs when the broker is not
reachable, for example, when it is down.

Appreciate any help.
Thank you.



-- 
View this message in context: http://www.nabble.com/Specifying-a-timeout-value-for-createTopicConnection%28%29-method-tp18368943p18407473.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.