spring-framework / org.springframework.util.backoff / FixedBackOff

FixedBackOff

open class FixedBackOff : BackOff

A simple BackOff implementation that provides a fixed interval between two attempts and a maximum number of retries.

Author
Stephane Nicoll

Since
4.1

Constructors

<init>

FixedBackOff()

Create an instance with an interval of {@value #DEFAULT_INTERVAL} ms and an unlimited number of attempts.

FixedBackOff(interval: Long, maxAttempts: Long)

Create an instance.

Properties

DEFAULT_INTERVAL

static val DEFAULT_INTERVAL: Long

The default recovery interval: 5000 ms = 5 seconds.

UNLIMITED_ATTEMPTS

static val UNLIMITED_ATTEMPTS: Long

Constant value indicating an unlimited number of attempts.

Functions

getInterval

open fun getInterval(): Long

Return the interval between two attempts in milliseconds.

getMaxAttempts

open fun getMaxAttempts(): Long

Return the maximum number of attempts in milliseconds.

setInterval

open fun setInterval(interval: Long): Unit

Set the interval between two attempts in milliseconds.

setMaxAttempts

open fun setMaxAttempts(maxAttempts: Long): Unit

Set the maximum number of attempts in milliseconds.

start

open fun start(): BackOffExecution