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
Modifier and TypeInterfaceDescriptionstatic final class
static final class
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondelay
(int recoveryAttempt) Returns the delay to use for a given attempt.static BackOffDelayPolicy
A policy with a constant delay.static BackOffDelayPolicy
fixedWithInitialDelay
(Duration initialDelay, Duration delay) A policy with a first delay and then a constant delay.static BackOffDelayPolicy
fixedWithInitialDelay
(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
-