public class RetryOptions extends Object
GatewayClients
.Constructor and Description |
---|
RetryOptions(Duration firstBackoff,
Duration maxBackoffInterval,
int maxRetries,
Scheduler scheduler)
Create a retry configuration object.
|
Modifier and Type | Method and Description |
---|---|
Backoff |
getBackoff()
Retrieve the backoff function used for retrying.
|
Scheduler |
getBackoffScheduler()
Returns a scheduler provided every reconnect attempt, as backoff delay.
|
Jitter |
getJitter()
Retrieve the jitter to be applied on each backoff delay.
|
int |
getMaxRetries()
Returns the number of retries.
|
RetryContext |
getRetryContext()
Retrieve a stateful context object to hold current attempt count and backoff delay on each retry.
|
public RetryOptions(Duration firstBackoff, Duration maxBackoffInterval, int maxRetries, Scheduler scheduler)
firstBackoff
- the Duration to backoff on first attemptsmaxBackoffInterval
- the maximum backoff DurationmaxRetries
- the maximum amount of retries to attempt a reconnectscheduler
- the backoff scheduler used for reconnect delayspublic RetryContext getRetryContext()
public Backoff getBackoff()
public Jitter getJitter()
public int getMaxRetries()
public Scheduler getBackoffScheduler()