public static class RecoveryDelayHandler.ExponentialBackoffDelayHandler extends Object implements RecoveryDelayHandler
RecoveryDelayHandler
that uses the Fibonacci sequence (by default) to increase the recovery delay time after each failed attempt.
You can optionally use your own backoff sequence.RecoveryDelayHandler.DefaultRecoveryDelayHandler, RecoveryDelayHandler.ExponentialBackoffDelayHandler
Constructor and Description |
---|
ExponentialBackoffDelayHandler()
Default Constructor.
|
ExponentialBackoffDelayHandler(List<Long> sequence)
Constructor for passing your own backoff sequence
|
Modifier and Type | Method and Description |
---|---|
long |
getDelay(int recoveryAttempts)
Get the time to sleep (in milliseconds) before attempting to reconnect and recover again.
|
public ExponentialBackoffDelayHandler()
public ExponentialBackoffDelayHandler(List<Long> sequence)
sequence
- List of recovery delay values in milliseconds.IllegalArgumentException
- if the sequence is null or emptypublic long getDelay(int recoveryAttempts)
RecoveryDelayHandler
getDelay
in interface RecoveryDelayHandler
recoveryAttempts
- The number of recovery attempts so far.Copyright © 2022 VMware, Inc. or its affiliates.. All rights reserved.