Setting maxAttempts to 1 #5289
Answered
by
sugmanue
brycechesternewman
asked this question in
Q&A
|
Hi, Is there a better type safe way to set maxAttemts to 1? |
Answered by
sugmanue
Jun 12, 2024
Replies: 1 comment 2 replies
|
What you're doing works fine in Java. Can you elaborate on what issues you're getting?. Note that setting ClientOverrideConfiguration.builder().retryStrategy(AwsRetryStrategy.doNotRetry())You can also use the more functional way of S3AsyncClient.builder().overrideConfiguration(o -> o.retryStrategy(AwsRetryStrategy.doNotRetry()).build()Or even S3AsyncClient.builder().overrideConfiguration(o -> o.retryStrategy(b -> b.maxAttempts(1)).build() |
2 replies
Answer selected by
sugmanue
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @brycechesternewman,
What you're doing works fine in Java. Can you elaborate on what issues you're getting?.
Note that setting
maxAttemptsto 1 is equivalent to disabling retries, for that you can useAwsRetryStrategy.doNotRetry(), e.g.,You can also use the more functional way of
.overrideConfiguration(Consumer<OverrideConfiguration.Builder>), (see here), e.g.,Or even
See here and here.