Skip to content

Setting maxAttempts to 1 #5289

Discussion options

You must be logged in to vote

Hi @brycechesternewman,

What you're doing works fine in Java. Can you elaborate on what issues you're getting?.

Note that setting maxAttempts to 1 is equivalent to disabling retries, for that you can use AwsRetryStrategy.doNotRetry(), e.g.,

ClientOverrideConfiguration.builder().retryStrategy(AwsRetryStrategy.doNotRetry())

You can also use the more functional way of .overrideConfiguration(Consumer<OverrideConfiguration.Builder>), (see here), e.g.,

S3AsyncClient.builder().overrideConfiguration(o -> o.retryStrategy(AwsRetryStrategy.doNotRetry()).build()

Or even

S3AsyncClient.builder().overrideConfiguration(o -> o.retryStrategy(b -> b.maxAttempts(1)).build()

See here and here.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@brycechesternewman
Comment options

@brycechesternewman
Comment options

Answer selected by sugmanue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants