Annotation Interface 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. If RetryOptions are present on ActivityOptions or ChildWorkflowOptions the fields that are not default take precedence over parameters of this annotation.
  • Element Details

    • 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 through RetryOptions.Builder.setInitialInterval(Duration).
      Default:
      0L
    • backoffCoefficient

      double backoffCoefficient
      Coefficient used to calculate the next retry interval. The next retry interval is previous interval multiplied by this coefficient. Must be 1 or larger. Default is 2.0.
      Default:
      0.0
    • maximumAttempts

      int maximumAttempts
      Maximum number of attempts. When exceeded the retries stop even if not expired yet. Must be 1 or bigger. Default is unlimited.
      Default:
      0
    • maximumIntervalSeconds

      long maximumIntervalSeconds
      Maximum interval between retries. Exponential backoff leads to interval increase. This value is the cap of the increase. Default is 100x initialIntervalSeconds().
      Default:
      0L
    • doNotRetry

      String[] doNotRetry
      List of failure types to not retry. The failure type of an exception is its full class name. It can be also explicitly specified by throwing an ApplicationFailure
      Default:
      {}