hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1176) Support proxy failover per ProxySelector API
Date Mon, 27 Jan 2014 11:04:38 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13882752#comment-13882752
] 

Oleg Kalnichevski commented on HTTPCLIENT-1176:
-----------------------------------------------

Hi Sivasubramaniam 

While this patch represents a functional solution, it is also very wasteful and inefficient.
With your changes the route planner would end up creating a disposable socket for *every*
request. While this might be appropriate in some cases it certainly cannot serve as a general
purpose solution. 

Please note that ProxySelector provides #connectFailed method which is intended specifically
for informing the selector about out of service proxy nodes [1] This is the method that you
ought to be using. The challenge here is to find the right place to plug it into the existing
request execution framework.

Oleg

[1] http://download.java.net/jdk8/docs/api/java/net/ProxySelector.html#connectFailed-java.net.URI-java.net.SocketAddress-java.io.IOException-

> Support proxy failover per ProxySelector API
> --------------------------------------------
>
>                 Key: HTTPCLIENT-1176
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1176
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpConn
>    Affects Versions: 4.2 Beta1
>         Environment: All supported platforms/environments which use proxy failover
>            Reporter: Jan-Willem Maarse
>            Priority: Minor
>             Fix For: 4.4 Final
>
>         Attachments: ProxyFailoverFix.patch, ProxyFailoverTest.patch
>
>
> The ProxySelectorRoutePlanner selects a single proxy from the list returned by the java.net.ProxySelector
API. If the client can't open a socket to the proxy, other proxies in the list are ignored
and the request fails. It would be good if the Apache HttpClient could try other proxies in
the list before failing on socket errors. HttpURLConnection provides similar behavior. This
functionality is useful in network configurations where proxies can go up and down for maintenance,
for example.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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


Mime
View raw message