Search in sources :

Example 6 with RetryMode

use of software.amazon.awssdk.core.retry.RetryMode in project aws-sdk-java-v2 by aws.

the class KinesisRetryPolicy method resolveRetryPolicy.

public static RetryPolicy resolveRetryPolicy(SdkClientConfiguration config) {
    RetryPolicy configuredRetryPolicy = config.option(SdkClientOption.RETRY_POLICY);
    if (configuredRetryPolicy != null) {
        return addRetryConditions(configuredRetryPolicy);
    }
    RetryMode retryMode = RetryMode.resolver().profileFile(() -> config.option(SdkClientOption.PROFILE_FILE)).profileName(config.option(SdkClientOption.PROFILE_NAME)).defaultRetryMode(config.option(SdkClientOption.DEFAULT_RETRY_MODE)).resolve();
    return AwsRetryPolicy.forRetryMode(retryMode).toBuilder().applyMutation(KinesisRetryPolicy::addRetryConditions).additionalRetryConditionsAllowed(false).build();
}
Also used : RetryMode(software.amazon.awssdk.core.retry.RetryMode) AwsRetryPolicy(software.amazon.awssdk.awscore.retry.AwsRetryPolicy) RetryPolicy(software.amazon.awssdk.core.retry.RetryPolicy)

Aggregations

RetryMode (software.amazon.awssdk.core.retry.RetryMode)6 RetryPolicy (software.amazon.awssdk.core.retry.RetryPolicy)5 AwsRetryPolicy (software.amazon.awssdk.awscore.retry.AwsRetryPolicy)4 MethodSpec (com.squareup.javapoet.MethodSpec)1 Path (java.nio.file.Path)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Collectors (java.util.stream.Collectors)1 NonNullByDefault (org.eclipse.jdt.annotation.NonNullByDefault)1 Nullable (org.eclipse.jdt.annotation.Nullable)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1 AwsBasicCredentials (software.amazon.awssdk.auth.credentials.AwsBasicCredentials)1 AwsCredentials (software.amazon.awssdk.auth.credentials.AwsCredentials)1 ProfileCredentialsProvider (software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider)1 SdkClientConfiguration (software.amazon.awssdk.core.client.config.SdkClientConfiguration)1 ProfileFile (software.amazon.awssdk.profiles.ProfileFile)1 Type (software.amazon.awssdk.profiles.ProfileFile.Type)1 ProfileProperty (software.amazon.awssdk.profiles.ProfileProperty)1 Region (software.amazon.awssdk.regions.Region)1