Skip to content

Instantly share code, notes, and snippets.

@philgebhardt
Last active December 19, 2017 20:29
Show Gist options
  • Save philgebhardt/7bbc317490a10e912935bc28a99f2619 to your computer and use it in GitHub Desktop.
Save philgebhardt/7bbc317490a10e912935bc28a99f2619 to your computer and use it in GitHub Desktop.
This DynamoDB client is configured for batch processing
/**
* This dynamodb configuration is for batch processing, taking up to 30 seconds to finish communicating
* with the database
*/
public final AmazonDynamoDB getDynamoDBForBatchProcessing() {
return AmazonDynamoDBClientBuilder.standard()
.withRegion(this.regions)
.withClientConfiguration(new ClientConfiguration()
.withConnectionTimeout(500)
.withClientExecutionTimeout(30000)
// 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