hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ortwin Glück <ortwin.glu...@nose.ch>
Subject Re: Attempt to implement HA with HttpClient
Date Thu, 19 May 2005 08:59:30 GMT

You are subclassing the SimpleHttpConnectionManager which is not 
thread-safe. e.g. using the same SimpleHttpConnectionManager instance 
from different threads / method calls is not supported. Could this be 
the problem? What happens when you replace HAHttpConnectionManager with 
the SimpleHttpConnectionManager  or the 
MultiThreadedHttpConnectionManager? (no failover of course) but are you 
still seeing the problem with that ones?

Ortwin Glück

alex.x.atran@jpmorgan.com wrote:
> Apologies in advance if this is the incorrect mailing list.
> We are trying to implement High Avaliablity with HttpClient (great package 
> btw), we dont have the luxury of a load balancer to do this for now, so we 
> (I) thought we could do it programmatically.
> The way I thought would work, is to subclass the 
> SimpleHttpConnectionManager and return a connection that succeeded. Below 
> is the source for this implementation.
> Everything seems to work fine, the failover succeeds and the client 
> connects to the failover host. However, under heavy usage, and if the 
> primary host is down, the occasional error occurs, with the exception: 
> Address already in use: connect
> java.net.BindException: Address already in use: connect
>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
>         at 
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
>         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
>         at java.net.Socket.connect(Socket.java:452)
>         at java.net.Socket.connect(Socket.java:402)

To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org

View raw message