Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
DynamoDB Cookbook

You're reading from  DynamoDB Cookbook

Product type Book
Published in Sep 2015
Publisher
ISBN-13 9781784393755
Pages 266 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Tanmay Deshpande Tanmay Deshpande
Profile icon Tanmay Deshpande

Table of Contents (18) Chapters

DynamoDB Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
1. Taking Your First Steps with DynamoDB 2. Operating with DynamoDB Tables 3. Manipulating DynamoDB Items 4. Managing DynamoDB Indexes 5. Exploring Higher Level Programming Interfaces for DynamoDB 6. Securing DynamoDB 7. DynamoDB Best Practices 8. Integrating DynamoDB with other AWS Services 9. Developing Web Applications using DynamoDB 10. Developing Mobile Applications using DynamoDB Index

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 called shouldRetry, which we need to implement as per our needs. Here is a sample CustomRetryCondition class:

    public class CustomRetryCondition implements RetryCondition {
      public boolean shouldRetry(AmazonWebServiceRequest originalRequest,
      ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}