Performing auto-retries on DynamoDB errors

As mentioned in the previous recipe, we can perform auto-retries on DynamoDB requests if we get errors. In this recipe, we are going to see how to perform auto-retries.

Getting ready

To get started with this recipe, you should have your workstation ready with the Eclipse IDE.

How to do it…

Auto-retries are required if we get any errors during the first request. We can use the Amazon client configurations to set our retry strategy. By default, the DynamoDB client auto-retries a request if any error is generated three times. If we think that this is not efficient for us, then we can define this on our own, as follows:

  1. First of all, we need to create a custom implementation of RetryCondition. It contains a method ...

Get DynamoDB Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.