On Thu, 2008-03-20 at 22:05 -0700, Ankur Shah wrote:
> I am using httpclient to connect to a remote server. Now for each primary
> server there's also a backup failover server that i must talk to if
> connection attempts with the primary server fails. To achieve
> this what i'd ideally like to do is have HttpClient use a custom factory
> that tries to create a socket connection with the primary server and if that
> fails (or times out), it'll go about  talking to backup server (and retry a
> few times before giving up altogether).
> 
> Now, searching on the web, i did find references to a
> MultiHomeProtocolSocketFactory (that extends DefaultSocketFactory) that is
> presumably in apache contrib package. But what that does is that in the
> overriden
> createSocket method, it takes host as a param (among other thing) and then
> simply does a InetAddress.getAllByName which is not what i want. From what i
> understand this caters to a DNS based failover which is not the case here.
> 
> What i'd ideally like to do is create a factory and have a createSocket
> method that takes primary and secondary host and port as args and then tries
> both. I am not sure though how can i make HttpConnection class
> invoke my method.

Ankur,

What's the point of trying to implement the failover support on the
ProtocolSocketFactory level? What's wrong with just retrying failed
requests against a secondary server in case the primary one is
unavailable?  

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to