maxAttempts

val maxAttempts: Int? = null

Maximum number of attempts before giving up retrying.

The policy gives up retrying when either at least the given number of attempts is reached, or the maxDuration (if set) is reached first. If both maxAttempts and maxDuration are null, the policy will retry indefinitely.

Note: The number of actual retries may be higher than the provided value. This is due to the nature of the run operation, which executes the closure on the service and sends the result afterward to Restate.