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.
virtual Nullable<double> BackoffRate { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: 2
Errors
Errors to retry.
virtual string[] Errors { get; }
Property Value
System.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.
virtual Duration Interval { get; }
Property Value
Remarks
Default: Duration.seconds(1)
JitterStrategy
Introduces a randomization over the retry interval.
virtual Nullable<JitterType> JitterStrategy { get; }
Property Value
System.Nullable<JitterType>
Remarks
Default: - No jitter strategy
MaxAttempts
How many times to retry this particular error.
virtual Nullable<double> MaxAttempts { get; }
Property Value
System.Nullable<System.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.
virtual Duration MaxDelay { get; }
Property Value
Remarks
Default: - No max delay