Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Set the default backoff strategy

git-svn-id: https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk@1406223 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 978c5165b8fe73780c8593296e608ffc265c80e8 1 parent 9cbafd6
@raymondfeng raymondfeng authored
View
5 modules/host-http/src/main/java/org/apache/tuscany/sca/host/http/client/HttpClientFactory.java
@@ -31,6 +31,7 @@
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.NoConnectionReuseStrategy;
import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.DefaultBackoffStrategy;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.apache.http.impl.conn.SchemeRegistryFactory;
import org.apache.http.params.BasicHttpParams;
@@ -129,6 +130,10 @@ public HttpClient createHttpClient() {
connectionManager.setMaxTotal(maxTotal);
DefaultHttpClient client = new DefaultHttpClient(connectionManager, defaultParameters);
+
+ // Set the default connection backoff
+ client.setConnectionBackoffStrategy(new DefaultBackoffStrategy());
+
if (timeToLive <= 0) {
client.setReuseStrategy(new NoConnectionReuseStrategy());
}
Please sign in to comment.
Something went wrong with that request. Please try again.