You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/01/07 11:30:28 UTC
svn commit: r1777766 -
/httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
Author: olegk
Date: Sat Jan 7 11:30:28 2017
New Revision: 1777766
URL: http://svn.apache.org/viewvc?rev=1777766&view=rev
Log:
HTTPCLIENT-1800: wrap redirect around retry in execChain
Modified:
httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
Modified: httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java?rev=1777766&r1=1777765&r2=1777766&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java (original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java Sat Jan 7 11:30:28 2017
@@ -1148,6 +1148,13 @@ public class HttpClientBuilder {
routePlannerCopy = new DefaultRoutePlanner(schemePortResolverCopy);
}
}
+
+ // Optionally, add service unavailable retry executor
+ final ServiceUnavailableRetryStrategy serviceUnavailStrategyCopy = this.serviceUnavailStrategy;
+ if (serviceUnavailStrategyCopy != null) {
+ execChain = new ServiceUnavailableRetryExec(execChain, serviceUnavailStrategyCopy);
+ }
+
// Add redirect executor, if not disabled
if (!redirectHandlingDisabled) {
RedirectStrategy redirectStrategyCopy = this.redirectStrategy;
@@ -1157,11 +1164,6 @@ public class HttpClientBuilder {
execChain = new RedirectExec(execChain, routePlannerCopy, redirectStrategyCopy);
}
- // Optionally, add service unavailable retry executor
- final ServiceUnavailableRetryStrategy serviceUnavailStrategyCopy = this.serviceUnavailStrategy;
- if (serviceUnavailStrategyCopy != null) {
- execChain = new ServiceUnavailableRetryExec(execChain, serviceUnavailStrategyCopy);
- }
// Optionally, add connection back-off executor
if (this.backoffManager != null && this.connectionBackoffStrategy != null) {
execChain = new BackoffStrategyExec(execChain, this.connectionBackoffStrategy, this.backoffManager);