public static final class RetryOptions.Builder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
RetryOptions |
build()
Build RetryOptions without performing validation as validation should be done after merging
with
MethodRetry . |
RetryOptions.Builder |
setBackoffCoefficient(double backoffCoefficient)
Coefficient used to calculate the next retry interval.
|
RetryOptions.Builder |
setDoNotRetry(java.lang.String... doNotRetry)
List of application failures types to not retry.
|
RetryOptions.Builder |
setInitialInterval(java.time.Duration initialInterval)
Interval of the first retry.
|
RetryOptions.Builder |
setMaximumAttempts(int maximumAttempts)
Maximum number of attempts.
|
RetryOptions.Builder |
setMaximumInterval(java.time.Duration maximumInterval)
Maximum interval between retries.
|
RetryOptions |
validateBuildWithDefaults()
Validates property values and builds RetryOptions with default values.
|
public RetryOptions.Builder setInitialInterval(java.time.Duration initialInterval)
public RetryOptions.Builder setBackoffCoefficient(double backoffCoefficient)
public RetryOptions.Builder setMaximumAttempts(int maximumAttempts)
public RetryOptions.Builder setMaximumInterval(java.time.Duration maximumInterval)
@SafeVarargs public final RetryOptions.Builder setDoNotRetry(java.lang.String... doNotRetry)
An application failure is represented as ApplicationFailure
. The type of the
failure is stored in the ApplicationFailure.getType()
property. An ApplicationFailure
instance is created through ApplicationFailure.newFailure(String,
String, Object...)
. An ApplicationFailure created through ApplicationFailure.newNonRetryableFailure(String, String, Object...)
will have ApplicationFailure.isNonRetryable()
property set to true which means that it is not retried
even if the type of failure is not included into DoNotRetry list.
If an activity or workflow throws any exception which is not ApplicationFailure
then the exception is converted to ApplicationFailure
with the fully qualified name
of the exception as type value.
Note that activity failures are wrapped into ActivityFailure
exception. So if an
activity failure is not handled the workflow retry policy is going to see ActivityFailure
which is always retryable, not the original exception. The same way a child workflow failure
is wrapped into ChildWorkflowFailure
.
Error
and CanceledFailure
are never retried and are not even passed to
this filter.
public RetryOptions build()
MethodRetry
.public RetryOptions validateBuildWithDefaults()