Show / Hide Table of Contents

Class RetryProps

Retry details.

Inheritance
object
RetryProps
Implements
IRetryProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.StepFunctions
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class RetryProps : IRetryProps
Syntax (vb)
Public Class RetryProps Implements 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

Constructors

RetryProps()

Retry details.

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.

Constructors

RetryProps()

Retry details.

public RetryProps()
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);

Properties

BackoffRate

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

public double? BackoffRate { get; set; }
Property Value

double?

Remarks

Default: 2

Errors

Errors to retry.

public string[]? Errors { get; set; }
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.

public Duration? Interval { get; set; }
Property Value

Duration

Remarks

Default: Duration.seconds(1)

JitterStrategy

Introduces a randomization over the retry interval.

public JitterType? JitterStrategy { get; set; }
Property Value

JitterType?

Remarks

Default: - No jitter strategy

MaxAttempts

How many times to retry this particular error.

public double? MaxAttempts { get; set; }
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.

public Duration? MaxDelay { get; set; }
Property Value

Duration

Remarks

Default: - No max delay

Implements

IRetryProps
Back to top Generated by DocFX