Set the Maximum Retry Limit

If AWS Java SDK receives an error from the system, it retries the request. The default number of times it retries the request is five. The default retry limit can be changed in the client application.

CAUTION:
The client reports the final error and not the initial failure, which can mask the details of the underlying issue.
Note: Set the maxErrorRetry property of the ClientConfiguration object to 0 to disable the default retry policy.

Example: Changing the Maximum Retry Value

ClientConfiguration config = new ClientConfiguration().withMaxErrorRetry(0);

AmazonS3 s3 = new AmazonS3Client(credentials, config);