Show / Hide Table of Contents

Interface IRetryProps

Retry details.

Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IRetryProps
Syntax (vb)
Public Interface IRetryProps
Remarks

ExampleMetadata: infused

Examples
var parallel = new Parallel(this, "Do the work in parallel");

            // Add branches to be executed in parallel
            var shipItem = new Pass(this, "ShipItem");
            var sendInvoice = new Pass(this, "SendInvoice");
            var restock = new Pass(this, "Restock");
            parallel.Branch(shipItem);
            parallel.Branch(sendInvoice);
            parallel.Branch(restock);

            // Retry the whole workflow if something goes wrong with exponential backoff
            parallel.AddRetry(new RetryProps {
                MaxAttempts = 1,
                MaxDelay = Duration.Seconds(5),
                JitterStrategy = JitterType.FULL
            });

            // How to recover from errors
            var sendFailureNotification = new Pass(this, "SendFailureNotification");
            parallel.AddCatch(sendFailureNotification);

            // What to do in case everything succeeded
            var closeOrder = new Pass(this, "CloseOrder");
            parallel.Next(closeOrder);

Synopsis

Properties

BackoffRate

Multiplication for how much longer the wait interval gets on every retry.

Errors

Errors to retry.

Interval

How many seconds to wait initially before retrying.

JitterStrategy

Introduces a randomization over the retry interval.

MaxAttempts

How many times to retry this particular error.

MaxDelay

Maximum limit on retry interval growth during exponential backoff.

Properties

BackoffRate

Multiplication for how much longer the wait interval gets on every retry.

double? BackoffRate { get; }
Property Value

double?

Remarks

Default: 2

Errors

Errors to retry.

string[]? Errors { get; }
Property Value

string[]

Remarks

A list of error strings to retry, which can be either predefined errors (for example Errors.NoChoiceMatched) or a self-defined error.

Default: All errors

Interval

How many seconds to wait initially before retrying.

Duration? Interval { get; }
Property Value

Duration

Remarks

Default: Duration.seconds(1)

JitterStrategy

Introduces a randomization over the retry interval.

JitterType? JitterStrategy { get; }
Property Value

JitterType?

Remarks

Default: - No jitter strategy

MaxAttempts

How many times to retry this particular error.

double? MaxAttempts { get; }
Property Value

double?

Remarks

May be 0 to disable retry for specific errors (in case you have a catch-all retry policy).

Default: 3

MaxDelay

Maximum limit on retry interval growth during exponential backoff.

Duration? MaxDelay { get; }
Property Value

Duration

Remarks

Default: - No max delay

Back to top Generated by DocFX