diff --git a/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsClient.java b/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsClient.java index dddf488d2..e752f7fb2 100644 --- a/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsClient.java +++ b/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsClient.java @@ -16,13 +16,6 @@ package com.nike.cerberus.aws.sts; -import static io.github.resilience4j.decorators.Decorators.ofSupplier; - -import io.github.resilience4j.retry.IntervalFunction; -import io.github.resilience4j.retry.Retry; -import io.github.resilience4j.retry.RetryConfig; -import java.time.Duration; -import java.time.temporal.ChronoUnit; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -31,32 +24,15 @@ public class AwsStsClient { private final AwsStsHttpClient httpClient; - private static final RetryConfig RETRY_CONFIG = - RetryConfig.custom() - .maxAttempts(5) - .intervalFunction( - IntervalFunction.ofExponentialBackoff(Duration.of(250, ChronoUnit.MILLIS))) - .build(); - - private final Retry retry = Retry.of(this.getClass().getName(), RETRY_CONFIG); - @Autowired public AwsStsClient(AwsStsHttpClient httpClient) { this.httpClient = httpClient; } public GetCallerIdentityResponse getCallerIdentity(AwsStsHttpHeader header) { - return ofSupplier( - () -> { - GetCallerIdentityFullResponse response = - httpClient.execute( - header.getRegion(), - header.generateHeaders(), - GetCallerIdentityFullResponse.class); - return response.getGetCallerIdentityResponse(); - }) - .withRetry(retry) - .decorate() - .get(); + GetCallerIdentityFullResponse response = + httpClient.execute( + header.getRegion(), header.generateHeaders(), GetCallerIdentityFullResponse.class); + return response.getGetCallerIdentityResponse(); } } diff --git a/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsHttpClient.java b/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsHttpClient.java index 6149e8cf6..0ad61a534 100644 --- a/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsHttpClient.java +++ b/cerberus-web/src/main/java/com/nike/cerberus/aws/sts/AwsStsHttpClient.java @@ -42,8 +42,8 @@ public class AwsStsHttpClient { private static final String DEFAULT_GET_CALLER_IDENTITY_ACTION = "Action=GetCallerIdentity&Version=2011-06-15"; private static final String DEFAULT_METHOD = "POST"; - protected static final int DEFAULT_AUTH_RETRIES = 3; - private static final int DEFAULT_RETRY_INTERVAL_IN_MILLIS = 200; + protected static final int DEFAULT_AUTH_RETRIES = 5; + private static final int DEFAULT_RETRY_INTERVAL_IN_MILLIS = 250; private static final int DEFAULT_TIMEOUT = 15; private static final TimeUnit DEFAULT_TIMEOUT_UNIT = TimeUnit.SECONDS; private final OkHttpClient httpClient; diff --git a/gradle.properties b/gradle.properties index 8d6922ddc..038e7c345 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,6 +14,6 @@ # limitations under the License. # -version=4.7.1 +version=4.7.2 group=com.nike.cerberus springBootVersion=2.3.2.RELEASE