Package io.dapr.client.domain
Class ConstantFailurePolicy
java.lang.Object
io.dapr.client.domain.ConstantFailurePolicy
- All Implemented Interfaces:
FailurePolicy
A failure policy that applies a constant retry interval for job retries.
This implementation of
FailurePolicy retries a job a fixed number of times
with a constant delay between each retry attempt.-
Constructor Summary
ConstructorsConstructorDescriptionConstantFailurePolicy(Integer maxRetries) Constructs aJobConstantFailurePolicywith the specified maximum number of retries.ConstantFailurePolicy(Duration durationBetweenRetries) Constructs aJobConstantFailurePolicywith the specified duration between retries. -
Method Summary
Modifier and TypeMethodDescriptionReturns the configured duration between retry attempts.Returns the type of failure policy.Returns the configured maximum number of retries.setDurationBetweenRetries(Duration durationBetweenRetries) Sets the duration to wait between retry attempts.setMaxRetries(int maxRetries) Sets the maximum number of retries allowed.
-
Constructor Details
-
ConstantFailurePolicy
Constructs aJobConstantFailurePolicywith the specified maximum number of retries.- Parameters:
maxRetries- the maximum number of retries
-
ConstantFailurePolicy
Constructs aJobConstantFailurePolicywith the specified duration between retries.- Parameters:
durationBetweenRetries- the duration to wait between retries
-
-
Method Details
-
setDurationBetweenRetries
Sets the duration to wait between retry attempts.- Parameters:
durationBetweenRetries- the duration between retries- Returns:
- a
JobFailurePolicyConstant.
-
setMaxRetries
Sets the maximum number of retries allowed.- Parameters:
maxRetries- the number of retries- Returns:
- a
JobFailurePolicyConstant.
-
getDurationBetweenRetries
Returns the configured duration between retry attempts.- Returns:
- the duration between retries
-
getMaxRetries
Returns the configured maximum number of retries.- Returns:
- the maximum number of retries
-
getFailurePolicyType
Returns the type of failure policy.- Specified by:
getFailurePolicyTypein interfaceFailurePolicy- Returns:
FailurePolicyType.CONSTANT
-