Module io.helidon.faulttolerance
Package io.helidon.faulttolerance
Class Retry.ExponentialRetryPolicy.Builder
- java.lang.Object
-
- io.helidon.faulttolerance.Retry.ExponentialRetryPolicy.Builder
-
- All Implemented Interfaces:
Builder<Retry.ExponentialRetryPolicy>
,Supplier<Retry.ExponentialRetryPolicy>
- Enclosing class:
- Retry.ExponentialRetryPolicy
public static class Retry.ExponentialRetryPolicy.Builder extends Object implements Builder<Retry.ExponentialRetryPolicy>
Fluent API builder forRetry.ExponentialRetryPolicy
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Retry.ExponentialRetryPolicy
build()
Build the instance from this builder.Retry.ExponentialRetryPolicy.Builder
calls(int calls)
Total number of calls (first + retries).Retry.ExponentialRetryPolicy.Builder
config(Config config)
Load all properties for this Retry Policy from configuration.Retry.ExponentialRetryPolicy.Builder
factor(int factor)
Multiplication factor.Retry.ExponentialRetryPolicy.Builder
initialDelay(Duration initialDelay)
Initial Delay.Retry.ExponentialRetryPolicy.Builder
jitter(long jitter)
Random part of the delay.Retry.ExponentialRetryPolicy.Builder
maxDelay(Duration maxDelay)
Max Delay in Milliseconds.
-
-
-
Method Detail
-
build
public Retry.ExponentialRetryPolicy build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<Retry.ExponentialRetryPolicy>
- Returns:
- instance of the built type
-
calls
public Retry.ExponentialRetryPolicy.Builder calls(int calls)
Total number of calls (first + retries).- Parameters:
calls
- how many times to call the method- Returns:
- updated builder instance
-
initialDelay
public Retry.ExponentialRetryPolicy.Builder initialDelay(Duration initialDelay)
Initial Delay.- Parameters:
initialDelay
- Duration- Returns:
- updated builder instance
-
maxDelay
public Retry.ExponentialRetryPolicy.Builder maxDelay(Duration maxDelay)
Max Delay in Milliseconds.- Parameters:
maxDelay
- long- Returns:
- updated builder instance
-
factor
public Retry.ExponentialRetryPolicy.Builder factor(int factor)
Multiplication factor.- Parameters:
factor
- multiplication factor- Returns:
- updated builder instance
-
jitter
public Retry.ExponentialRetryPolicy.Builder jitter(long jitter)
Random part of the delay. A number between[-jitter,+jitter]
is applied to delay each time delay is calculated.- Parameters:
jitter
- jitter duration- Returns:
- updated builder instance
-
config
public Retry.ExponentialRetryPolicy.Builder config(Config config)
Load all properties for this Retry Policy from configuration.
Configuration key default value description calls 10 Number of calls initial-delay 2 Initial delay max-delay 3 minutes Maximum delay factor 2 Multiplication factor jitter 50 milliseconds A number between [-jitter,+jitter]
applied to delay- Parameters:
config
- the config node to use- Returns:
- updated builder instance
-
-