Package com.uber.cadence.common
Annotation Type MethodRetry
-
@Retention(RUNTIME) @Target(METHOD) public @interface MethodRetry
Specifies a retry policy for a workflow or activity method. This annotation applies only to activity or workflow interface methods. For workflows currently used only for child workflow retries. Not required. When not used either retries don't happen or they are configured through correspondent options. IfRetryOptions
are present onActivityOptions
orChildWorkflowOptions
the fields that are not default take precedence over parameters of this annotation.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description double
backoffCoefficient
Coefficient used to calculate the next retry interval.java.lang.Class<? extends java.lang.Throwable>[]
doNotRetry
List of exceptions to skip retry.long
expirationSeconds
Maximum time to retry.long
initialIntervalSeconds
Interval of the first retry.int
maximumAttempts
Maximum number of attempts.long
maximumIntervalSeconds
Maximum interval between retries.
-
-
-
Element Detail
-
initialIntervalSeconds
long initialIntervalSeconds
Interval of the first retry. If coefficient is 1.0 then it is used for all retries. If not specified here must be provided throughRetryOptions.Builder.setInitialInterval(Duration)
.- Default:
- 0L
-
-
-
expirationSeconds
long expirationSeconds
Maximum time to retry. When exceeded the retries stop even if maximum retries is not reached yet. If not specified here must be provided throughRetryOptions.Builder.setExpiration(Duration)
.- Default:
- 0L
-
-
-
maximumIntervalSeconds
long maximumIntervalSeconds
Maximum interval between retries. Exponential backoff leads to interval increase. This value is the cap of the increase. Default is 100xinitialIntervalSeconds()
.- Default:
- 0L
-
-
-
doNotRetry
java.lang.Class<? extends java.lang.Throwable>[] doNotRetry
List of exceptions to skip retry. When matching an exact match is used. So adding RuntimeException.class to this list is going to include only RuntimeException itself, not all of its subclasses. The reason for such behaviour is to be able to support server side retries without knowledge of Java exception hierarchy.Error
andCancellationException
are never retried, so they are not allowed in this list.- Default:
- {}
-
-