Custom DynamoDB retry policy. This policy has a slightly different exponential backoff logic compared to the default retry policy.
Inheritance: Amazon.Runtime.Internal.DefaultRetryPolicy
Example #1
0
        public void TestLargeRetryCount()
        {
            var maxRetries = 1000;
            var maxMilliseconds = 1;

            var coreRetryPolicy = new DefaultRetryPolicy(100)
            {
                MaxBackoffInMilliseconds = maxMilliseconds
            };
            var ddbRetryPolicy = new DynamoDBRetryPolicy(100)
            {
                MaxBackoffInMilliseconds = maxMilliseconds
            };

            var context = new ExecutionContext(new RequestContext(false), null);
            for (int i = 0; i < maxRetries; i++)
            {
                context.RequestContext.Retries = i;
                coreRetryPolicy.WaitBeforeRetry(context);
                ddbRetryPolicy.WaitBeforeRetry(context);
            }
        }