Created
December 18, 2017 22:13
-
-
Save philgebhardt/5bfa712dd0c99f06263ce6c4a18c996a to your computer and use it in GitHub Desktop.
This DynamoDB client is configured for real-time processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * This dynamodb configuration is for real-time processing, which avoids spending too much time trying to | |
| * connect to dynamodb -- failing quickly with a ClientExecutionTimeout if dynamo cannot be reached within 1 second | |
| */ | |
| public final AmazonDynamoDB getDynamoDBForRealTimeProcessing() { | |
| return AmazonDynamoDBClientBuilder.standard() | |
| .withRegion(this.regions) | |
| .withClientConfiguration(new ClientConfiguration() | |
| .withConnectionTimeout(500) | |
| .withClientExecutionTimeout(1000) | |
| // Allow as many retries as possible until the client execution timeout expires | |
| .withMaxErrorRetry(Integer.MAX_VALUE)) | |
| .build(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment