Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IRetryPolicyBuilder

interface IRetryPolicyBuilder
Extends com.amazon.apmf.IStandard The IRetryPolicyBuilder allows callers to express retry preferences for Task failures. The retry policy consists of a minimum delay between successive retries and a count of retries to perform. A Task is marked TaskState::FAILED if retries are exhausted. It remains in TaskState::PENDING as it waits for the next execution opportunity.

Methods

minimumDelayBetweenRetries()

IRetryPolicyBuilder* minimumDelayBetweenRetries(com.amazon.apmf.MonotonicDuration delay)
Set the delay period required before retrying the given Task. Note that this delay will be applied to every subsequent retry.

Parameters

delay
com.amazon.apmf.MonotonicDuration — Required The minimum delay between retries.

Returns

IRetryPolicyBuilder* IRetryPolicyBuilder instance on success, error otherwise.

maximumRetryCount()

IRetryPolicyBuilder* maximumRetryCount(i32 count)
Set the maximum number of retries for the given Task. Note that when retry count exceeds the given number, Task Manager may remove the Task.

Parameters

count
i32 — Required The maximum number of retries.

Returns

IRetryPolicyBuilder* IRetryPolicyBuilder instance on success, error otherwise.

build()

IRetryPolicy* build()
Builds a IRetryPolicy instance with the set parameters. Note that calling this method after setting all parameters.

Returns

IRetryPolicy* A retry policy instance to be used in TaskBuilder.

Throws


Last modified on October 29, 2026