Re: Proxy Failover

2015-04-24 Thread Oleg Kalnichevski
On Thu, 2015-04-23 at 16:45 +, Mark A. Claassen wrote: I found some information on proxy failover and HttpClient, but not much. I was wondering, though, if my approach is OK. I realize there are inefficiencies, but before I go there, I want to know if I am even on the right track.

Re: Re:Re: Fw:Fw:PoolingHttpClientConnectionManager how to reuse the connection

2015-04-24 Thread Oleg Kalnichevski
On Fri, 2015-04-24 at 10:53 +0800, qustmrhu...@163.com wrote: I see the code about response close. AbortConnection not releaseConnection ,so the connection can be re-used.I am confused how the connection be re-used. public void close() throws IOException { if (this.connHolder !=

RE: Fw:Fw:PoolingHttpClientConnectionManager how to reuse the connection

2015-04-24 Thread Joan Balagueró
Hello, Regarding this posts: Any help in this issue would be much appreciated. Thanks mrhuang I am not quite sure I understand the issue. You should not even be using #releaseConnection in the first place. It is provided for compatibility with HC 3.x. You should always close

RE: Proxy Failover

2015-04-24 Thread Mark A. Claassen
How do I determine the failure type? If the connection can't be established, then it can be considered a proxy failure, but there are other possible errors that would not involve the proxy. If I just get a IOException back, how can I be sure of which type of failure it was? Also, is this

RE: Proxy Failover

2015-04-24 Thread Mark A. Claassen
Thank you. I did see this, but saw that is was never finished. I looked into the RetryHandler first, but wasn't sure if that was where to put it. It seemed the RetryHandler stuff was not intended to work on non-idempotent operations. That is why I tried to do this in the RoutePlanner, since

Re: Proxy Failover

2015-04-24 Thread Oleg Kalnichevski
On Fri, 2015-04-24 at 13:08 +, Mark A. Claassen wrote: Thank you. I did see this, but saw that is was never finished. I looked into the RetryHandler first, but wasn't sure if that was where to put it. It seemed the RetryHandler stuff was not intended to work on non-idempotent

Re: Fw:Fw:PoolingHttpClientConnectionManager how to reuse the connection

2015-04-24 Thread Stefan Magnus Landrø
I prefer this code-style: client.execute(new HttpGet(), response - { return response.getAllHeaders(); } ); The response handler will clean up everything. 2015-04-24 13:57 GMT+02:00 Oleg Kalnichevski ol...@apache.org: On Fri, 2015-04-24 at 13:22 +0200, Joan Balagueró wrote: Hello,

Re: Proxy Failover

2015-04-24 Thread Oleg Kalnichevski
On Fri, 2015-04-24 at 14:18 +, Mark A. Claassen wrote: How do I determine the failure type? If the connection can't be established, then it can be considered a proxy failure, but there are other possible errors that would not involve the proxy. If I just get a IOException back, how

RE: Proxy Failover

2015-04-24 Thread Mark A. Claassen
Well, I will keep at it. I was hoping there would be clear methodology to doing this. Can you explain how the 407, authentication required, would work. In my current example, I think this would be caught in my determineProxy method and not require a request to be resubmitted. Or is this what