retryExponentialBackoff

fun <T> Flux<T>.retryExponentialBackoff(    times: Long,     first: Duration,     max: Duration? = null,     jitter: Boolean = false,     doOnRetry: (RetryContext<T>) -> Unit? = null): Flux<T>

Extension to add a Flux.retry variant to Flux that uses an exponential backoff, as enabled by reactor-extra's Retry builder.

Author

Simon Baslé

Since

3.1.1

Parameters

times

the maximum number of retry attempts

first

the initial delay in retrying

max

the optional upper limit the delay can reach after subsequent backoffs

jitter

optional flag to activate random jitter in the backoffs

doOnRetry

optional Consumer-like lambda that will receive a RetryContext each time an attempt is made.


fun <T> Mono<T>.retryExponentialBackoff(    times: Long,     first: Duration,     max: Duration? = null,     jitter: Boolean = false,     doOnRetry: (RetryContext<T>) -> Unit? = null): Mono<T>

Extension to add a Mono.retry variant to Mono that uses an exponential backoff, as enabled by reactor-extra's Retry builder.

Author

Simon Baslé

Since

3.1.1

Parameters

times

the maximum number of retry attempts

first

the initial delay in retrying

max

the optional upper limit the delay can reach after subsequent backoffs

jitter

optional flag to activate random jitter in the backoffs

doOnRetry

optional Consumer-like lambda that will receive a RetryContext each time an attempt is made.