Class WithRetryConfig

java.lang.Object
software.amazon.lambda.durable.config.WithRetryConfig

public class WithRetryConfig extends Object
Configuration for DurableContext.withRetry(java.lang.String, java.util.function.BiFunction<java.lang.Integer, software.amazon.lambda.durable.DurableContext, T>).

Uses the same RetryStrategy shape that developers already know from StepConfig, so there are zero new retry concepts to learn. If no retry strategy is specified, RetryStrategies.Presets.DEFAULT is used.

  • Method Details

    • retryStrategy

      public RetryStrategy retryStrategy()
      Returns the retry strategy, or the default strategy if not specified. Same type as StepConfig.retryStrategy().
      Returns:
      the retry strategy, never null
    • wrapInChildContext

      public boolean wrapInChildContext()
      Returns whether the sync withRetry should wrap the retry loop in a child context.

      When true, the sync form behaves like the async form — all retry attempts are grouped under a single named child context in execution history. When false (the default), the retry loop runs directly on the caller's context.

      This setting has no effect on the async withRetryAsync methods, which always wrap in a child context.

      Returns:
      true if the sync retry loop should be wrapped in a child context
    • builder

      public static WithRetryConfig.Builder builder()
      Creates a new builder for WithRetryConfig.
      Returns:
      a new builder instance