Class WithRetryConfig.Builder
java.lang.Object
software.amazon.lambda.durable.config.WithRetryConfig.Builder
- Enclosing class:
- WithRetryConfig
Builder for creating
WithRetryConfig instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theWithRetryConfiginstance.retryStrategy(RetryStrategy retryStrategy) Sets the retry strategy.wrapInChildContext(boolean wrapInChildContext) Sets whether the syncwithRetryshould wrap the retry loop in a child context.
-
Method Details
-
retryStrategy
Sets the retry strategy. Optional — defaults toRetryStrategies.Presets.DEFAULTif not set.Reuses the exact same
RetryStrategyinterface fromStepConfig. All existing factory methods (RetryStrategies.exponentialBackoff(int, java.time.Duration, java.time.Duration, double, software.amazon.lambda.durable.retry.JitterStrategy),RetryStrategies.fixedDelay(int, java.time.Duration), presets, and custom lambdas) work without modification.- Parameters:
retryStrategy- the retry strategy to use- Returns:
- this builder for method chaining
-
wrapInChildContext
Sets whether the syncwithRetryshould wrap the retry loop in a child context. Optional — defaults tofalse.When enabled, the sync form groups all retry attempts under a single named child context in execution history, matching the behavior of the async form. This is useful when you want operation isolation but don't need a
DurableFuture.- Parameters:
wrapInChildContext-trueto wrap in a child context- Returns:
- this builder for method chaining
-
build
Builds theWithRetryConfiginstance.- Returns:
- a new config with the configured options
-