Package com.azure.core.amqp
Class AmqpRetryOptions
java.lang.Object
com.azure.core.amqp.AmqpRetryOptions
A set of options that can be specified to influence how retry attempts are made.
-
Constructor Summary
ConstructorDescriptionCreates an instance with the default retry options set.AmqpRetryOptions
(AmqpRetryOptions retryOptions) Creates an instance configured withretryOptions
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getDelay()
Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.Gets the maximum permissible delay between retry attempts.int
The maximum number of retry attempts before considering the associated operation to have failed.getMode()
Gets the approach to use for calculating retry delays.Gets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.int
hashCode()
Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.setMaxDelay
(Duration maximumDelay) Sets the maximum permissible delay between retry attempts.setMaxRetries
(int numberOfRetries) Sets the maximum number of retry attempts before considering the associated operation to have failed.setMode
(AmqpRetryMode retryMode) Sets the approach to use for calculating retry delays.setTryTimeout
(Duration tryTimeout) Sets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.
-
Constructor Details
-
AmqpRetryOptions
public AmqpRetryOptions()Creates an instance with the default retry options set. -
AmqpRetryOptions
Creates an instance configured withretryOptions
. This is not thread-safe.- Parameters:
retryOptions
- Retry options to configure new instance with.- Throws:
NullPointerException
- ifretryOptions
is null.
-
-
Method Details
-
setMode
Sets the approach to use for calculating retry delays.- Parameters:
retryMode
- The retry approach to use for calculating delays.- Returns:
- The updated
AmqpRetryOptions
object.
-
setMaxRetries
Sets the maximum number of retry attempts before considering the associated operation to have failed.- Parameters:
numberOfRetries
- The maximum number of retry attempts.- Returns:
- The updated
AmqpRetryOptions
object. - Throws:
IllegalArgumentException
- WhennumberOfRetries
is negative.
-
setDelay
Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.- Parameters:
delay
- The delay between retry attempts.- Returns:
- The updated
AmqpRetryOptions
object. - Throws:
NullPointerException
- Whendelay
is null.IllegalArgumentException
- Whendelay
is negative or zero.
-
setMaxDelay
Sets the maximum permissible delay between retry attempts.- Parameters:
maximumDelay
- The maximum permissible delay between retry attempts.- Returns:
- The updated
AmqpRetryOptions
object. - Throws:
NullPointerException
- WhenmaximumDelay
is null.IllegalArgumentException
- WhenmaximumDelay
is negative or zero.
-
setTryTimeout
Sets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.- Parameters:
tryTimeout
- The maximum duration to wait for completion.- Returns:
- The updated
AmqpRetryOptions
object. - Throws:
NullPointerException
- WhentryTimeout
is null.IllegalArgumentException
- WhentryTimeout
is negative or zero.
-
getMode
Gets the approach to use for calculating retry delays.- Returns:
- The approach to use for calculating retry delays.
-
getMaxRetries
public int getMaxRetries()The maximum number of retry attempts before considering the associated operation to have failed.- Returns:
- The maximum number of retry attempts before considering the associated operation to have failed.
-
getDelay
Gets the delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-approach.- Returns:
- The delay between retry attempts.
-
getMaxDelay
Gets the maximum permissible delay between retry attempts.- Returns:
- The maximum permissible delay between retry attempts.
-
getTryTimeout
Gets the maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.- Returns:
- The maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry.
-
equals
-
hashCode
public int hashCode()
-