diff options
Diffstat (limited to 'eaaf_core_utils/src/main')
-rw-r--r-- | eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientConfiguration.java | 6 | ||||
-rw-r--r-- | eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientFactory.java | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientConfiguration.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientConfiguration.java index ec7d115a..9239d0c5 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientConfiguration.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientConfiguration.java @@ -6,6 +6,7 @@ import java.util.UUID; import javax.annotation.Nonnull; import org.apache.commons.lang3.StringUtils; +import org.apache.http.client.ServiceUnavailableRetryStrategy; import at.gv.egiz.eaaf.core.exceptions.EaafConfigurationException; import at.gv.egiz.eaaf.core.impl.credential.KeyStoreConfiguration; @@ -62,7 +63,11 @@ public class HttpClientConfiguration { @Setter private boolean httpErrorRetryPost = false; + + @Setter + private ServiceUnavailableRetryStrategy serviceUnavailStrategy = null; + /** * Get a new HTTP-client configuration object. * @@ -195,5 +200,4 @@ public class HttpClientConfiguration { } } - } diff --git a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientFactory.java b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientFactory.java index b53226ce..647c0636 100644 --- a/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientFactory.java +++ b/eaaf_core_utils/src/main/java/at/gv/egiz/eaaf/core/impl/http/HttpClientFactory.java @@ -164,6 +164,13 @@ public class HttpClientFactory implements IHttpClientFactory { config.getHttpErrorRetryCount(), config.isHttpErrorRetryPost())); + if (config.getServiceUnavailStrategy() != null) { + log.debug("HttpClient configuration: {} set custom ServiceUnavailableRetryStrategy: {}", + config.getFriendlyName(), config.getServiceUnavailStrategy().getClass().getName()); + builder.setServiceUnavailableRetryStrategy(config.getServiceUnavailStrategy()); + + } + } else { log.info("Disable HTTP error-retry for http-client: {}", config.getFriendlyName()); builder.disableAutomaticRetries(); |