Package com.rabbitmq.stream
Interface BackOffDelayPolicy
- All Known Implementing Classes:
BackOffDelayPolicy.FixedWithInitialDelayAndTimeoutBackOffPolicy,BackOffDelayPolicy.FixedWithInitialDelayBackOffPolicy
public interface BackOffDelayPolicy
Contract to determine a delay between attempts of some task.
The task is typically the creation of a connection.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic final class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondelay(int recoveryAttempt) Returns the delay to use for a given attempt.static BackOffDelayPolicyA policy with a constant delay.static BackOffDelayPolicyfixedWithInitialDelay(Duration initialDelay, Duration delay) A policy with a first delay and then a constant delay.static BackOffDelayPolicyfixedWithInitialDelay(Duration initialDelay, Duration delay, Duration timeout) A policy with a first delay, then a constant delay until a timeout is reached.
-
Field Details
-
TIMEOUT
-
-
Method Details
-
fixed
A policy with a constant delay.- Parameters:
delay-- Returns:
- the constant delay policy
-
fixedWithInitialDelay
A policy with a first delay and then a constant delay.- Parameters:
initialDelay-delay-- Returns:
- the policy with an initial delay
-
fixedWithInitialDelay
static BackOffDelayPolicy fixedWithInitialDelay(Duration initialDelay, Duration delay, Duration timeout) A policy with a first delay, then a constant delay until a timeout is reached.- Parameters:
initialDelay-delay-timeout-- Returns:
- the policy with an initial delay
-
delay
Returns the delay to use for a given attempt.The policy can return the TIMEOUT constant to indicate that the task has reached a timeout.
- Parameters:
recoveryAttempt-- Returns:
- the delay, TIMEOUT if the task should stop being retried
-