- All Superinterfaces:
Prototype.Api
,Prototype.Factory<CircuitBreaker>
- All Known Implementing Classes:
CircuitBreakerConfig.BuilderBase.CircuitBreakerConfigImpl
Interface generated from definition. Please add javadoc to the definition interface.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Fluent API builder forCircuitBreaker
.static class
CircuitBreakerConfig.BuilderBase<BUILDER extends CircuitBreakerConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends CircuitBreakerConfig> Fluent API builder base forCircuitBreaker
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionapplyOn()
These throwables will be considered failures.static CircuitBreakerConfig.Builder
builder()
Create a new fluent API builder to customize configuration.static CircuitBreakerConfig.Builder
builder
(CircuitBreakerConfig instance) Create a new fluent API builder from an existing instance.static CircuitBreakerConfig
create()
Create a new instance with default values.static CircuitBreakerConfig
Create a new instance from configuration.delay()
How long to wait before transitioning from open to half-open state.int
How many failures out of 100 will trigger the circuit to open.executor()
Executor service to schedule future tasks.name()
skipOn()
These throwables will not be considered failures, all other will.int
How many successful calls will close a half-open circuit.int
volume()
Rolling window size used to calculate ratio of failed requests.Methods inherited from interface io.helidon.builder.api.Prototype.Factory
build
-
Field Details
-
DEFAULT_ERROR_RATIO
static final int DEFAULT_ERROR_RATIO- See Also:
-
DEFAULT_SUCCESS_THRESHOLD
static final int DEFAULT_SUCCESS_THRESHOLD- See Also:
-
DEFAULT_VOLUME
static final int DEFAULT_VOLUME- See Also:
-
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance
- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config
- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
name
-
delay
Duration delay()How long to wait before transitioning from open to half-open state.- Returns:
- delay
-
errorRatio
int errorRatio()How many failures out of 100 will trigger the circuit to open. This is adapted to thevolume()
used to handle the window of requests.If errorRatio is 40, and volume is 10, 4 failed requests will open the circuit. Default is 60.
- Returns:
- percent of failure that trigger the circuit to open
- See Also:
-
volume
int volume()Rolling window size used to calculate ratio of failed requests. Default is 10.- Returns:
- how big a window is used to calculate error errorRatio
- See Also:
-
successThreshold
int successThreshold()How many successful calls will close a half-open circuit. Nevertheless, the first failed call will open the circuit again. Default is 1.- Returns:
- number of calls
-
executor
Optional<ExecutorService> executor()Executor service to schedule future tasks.- Returns:
- executor to use
-
skipOn
These throwables will not be considered failures, all other will.- Returns:
- throwable classes to not be considered a failure
- See Also:
-
applyOn
These throwables will be considered failures.- Returns:
- throwable classes to be considered a failure
- See Also:
-