You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Ishitori <Is...@bk.ru> on 2011/11/16 14:52:21 UTC
Connection timeout 20 sec
I have 2 failover brokers and the following configuration:
failover:(tcp://broker-1:61616,tcp://broker-2:61616)?randomize=true&transport.initialReconnectDelay=10&transport.startupMaxReconnectAttempts=1&transport.maxReconnectDelay=1000&transport.useExponentialBackOff=false&transport.timeout=3000&transport.maxReconnectAttempts=1&wireFormat.cacheEnabled=false&nms.AsyncSend=true
I found that if I shutown the broker-2, then I will have to long a lot of
time until connection is established. I analyzed logs and found that while
trying to connect to broker-2 client waits 20 seconds! But I have specified
transport.timeout=3000 and I can't understand, why client waits for 20
seconds.
What could be the problem? Maybe I am missing aanother parameter?
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-timeout-20-sec-tp4076349p4076349.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection timeout 20 sec
Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2011-11-17 at 22:29 -0800, Ishitori wrote:
> It seems I found the problem. It was a well-known problem of .NET: Connect()
> method of the socket class doesn't have timeout property.
> http://www.codeproject.com/KB/IP/TimeOutSocket.aspx And it takes from 20 to
> 30 seconds for .NET to understand that connection cannot be established.
>
> I've implemented a workaround in ActiveMQ.NMS client, so now it's working.
> So problem is resolved, thanks to everyone.
>
> By the way, it is my second change in the source code of ActiveMQ.NMS
> client. I am thinking about sharing it with the community. Where should I
> send my changes for checking? Links/emails are welcomed :)
>
You can create a jira issue and attach you patch file along with unit
tests to show the issue and ensure it stays fixed once a fix is applied.
Just make sure to tick the grant license to apache option when uploading
you files:
https://issues.apache.org/jira/browse/AMQNET
Regards
--
Tim Bish
------------
FuseSource
Email: tim.bish@fusesource.com
Web: http://fusesource.com
Twitter: tabish121
Blog: http://timbish.blogspot.com/
Re: Connection timeout 20 sec
Posted by Ishitori <Is...@bk.ru>.
It seems I found the problem. It was a well-known problem of .NET: Connect()
method of the socket class doesn't have timeout property.
http://www.codeproject.com/KB/IP/TimeOutSocket.aspx And it takes from 20 to
30 seconds for .NET to understand that connection cannot be established.
I've implemented a workaround in ActiveMQ.NMS client, so now it's working.
So problem is resolved, thanks to everyone.
By the way, it is my second change in the source code of ActiveMQ.NMS
client. I am thinking about sharing it with the community. Where should I
send my changes for checking? Links/emails are welcomed :)
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-timeout-20-sec-tp4076349p4082303.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection timeout 20 sec
Posted by Ishitori <Is...@bk.ru>.
Yes, I am using NMS client.
If I remove every parameter as you adviced and try to send a message when
broker-2 is turned off I get "connect fail" message in log after ~20 seconds
passed. So, I believe that my parameters have no effects on this at all. Can
I miss something?
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-timeout-20-sec-tp4076349p4080230.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection timeout 20 sec
Posted by Torsten Mielke <to...@fusesource.com>.
This is an NMS client right?
The failover url does not even work with a pure Java client.
Do you see the same behavior when using a simple url like
failover:(tcp://broker-1:61616,tcp://broker-2:61616)
without any extra configuration?
I just tested it again using a Java client (but needed to change the url syntax slightly) and it works as expected.
As soon as broker-1 is shutdown, it reconnects to broker-2.
Torsten Mielke
torsten@fusesource.com
tmielke@blogspot.com
On Nov 16, 2011, at 4:05 PM, Ishitori wrote:
> ActiveMQ version is 5.5.0.
> Yes, the port is not listeneed at all, because I stop ActiveMQ windows
> service for broker-2.
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Connection-timeout-20-sec-tp4076349p4076625.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection timeout 20 sec
Posted by Ishitori <Is...@bk.ru>.
ActiveMQ version is 5.5.0.
Yes, the port is not listeneed at all, because I stop ActiveMQ windows
service for broker-2.
--
View this message in context: http://activemq.2283324.n4.nabble.com/Connection-timeout-20-sec-tp4076349p4076625.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Connection timeout 20 sec
Posted by Torsten Mielke <to...@fusesource.com>.
What version of ActiveMQ are you using?
Will the broker-2 be shutdown completely, i.e. not listener on port 61616?
I have recently tested a similar scenario and found it working alright.
Torsten Mielke
torsten@fusesource.com
tmielke@blogspot.com
On Nov 16, 2011, at 2:52 PM, Ishitori wrote:
> I have 2 failover brokers and the following configuration:
>
> failover:(tcp://broker-1:61616,tcp://broker-2:61616)?randomize=true&transport.initialReconnectDelay=10&transport.startupMaxReconnectAttempts=1&transport.maxReconnectDelay=1000&transport.useExponentialBackOff=false&transport.timeout=3000&transport.maxReconnectAttempts=1&wireFormat.cacheEnabled=false&nms.AsyncSend=true
>
> I found that if I shutown the broker-2, then I will have to long a lot of
> time until connection is established. I analyzed logs and found that while
> trying to connect to broker-2 client waits 20 seconds! But I have specified
> transport.timeout=3000 and I can't understand, why client waits for 20
> seconds.
>
> What could be the problem? Maybe I am missing aanother parameter?
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Connection-timeout-20-sec-tp4076349p4076349.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.