Search in sources :

Example 1 with JerseyClientWithRetryBackoffConfiguration

use of uk.gov.ida.configuration.JerseyClientWithRetryBackoffConfiguration in project verify-hub by alphagov.

the class MatchingServiceRequestSenderTest method setBackOffClient.

private static void setBackOffClient() {
    final List<String> exceptionsToCatch = List.of(ConnectTimeoutException.class.getName(), SocketException.class.getName(), SocketTimeoutException.class.getName(), NoHttpResponseException.class.getName());
    JerseyClientWithRetryBackoffConfiguration jerseyClientConfiguration = aJerseyClientWithRetryBackoffHandlerConfiguration().withTimeout(Duration.seconds(1)).withRetryBackoffPeriod(Duration.seconds(1)).withRetryExceptionList(exceptionsToCatch).withChunkedEncodingEnabled(false).withNumRetries(2).build();
    ClientProvider provider = new ClientProvider(samlSoapProxyApp.getEnvironment(), jerseyClientConfiguration, true, MatchingServiceRequestSenderTest.class.getSimpleName());
    backOffClient = provider.get();
}
Also used : NoHttpResponseException(org.apache.http.NoHttpResponseException) SocketException(java.net.SocketException) SocketTimeoutException(java.net.SocketTimeoutException) ClientProvider(uk.gov.ida.restclient.ClientProvider) JerseyClientWithRetryBackoffConfiguration(uk.gov.ida.configuration.JerseyClientWithRetryBackoffConfiguration) ConnectTimeoutException(org.apache.http.conn.ConnectTimeoutException)

Aggregations

SocketException (java.net.SocketException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 NoHttpResponseException (org.apache.http.NoHttpResponseException)1 ConnectTimeoutException (org.apache.http.conn.ConnectTimeoutException)1 JerseyClientWithRetryBackoffConfiguration (uk.gov.ida.configuration.JerseyClientWithRetryBackoffConfiguration)1 ClientProvider (uk.gov.ida.restclient.ClientProvider)1