Setting maxAttempts to 1 #5289
-
Hi, Is there a better type safe way to set maxAttemts to 1?
|
Beta Was this translation helpful? Give feedback.
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() |
Beta Was this translation helpful? Give feedback.
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 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.