public static class BulkheadConfig.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
Builder(BulkheadConfig bulkheadConfig) |
| Modifier and Type | Method and Description |
|---|---|
BulkheadConfig |
build()
Builds a BulkheadConfig
|
BulkheadConfig.Builder |
fairCallHandlingStrategyEnabled(boolean fairCallHandlingEnabled)
Indicates whether FairSync or NonfairSync should be used in Semaphore.
|
BulkheadConfig.Builder |
maxConcurrentCalls(int maxConcurrentCalls)
Configures the max amount of concurrent calls the bulkhead will support.
|
BulkheadConfig.Builder |
maxWaitDuration(java.time.Duration maxWaitDuration)
Configures a maximum amount of time which the calling thread will wait to enter the
bulkhead.
|
BulkheadConfig.Builder |
writableStackTraceEnabled(boolean writableStackTraceEnabled)
Enables writable stack traces.
|
public Builder()
public Builder(BulkheadConfig bulkheadConfig)
public BulkheadConfig.Builder maxConcurrentCalls(int maxConcurrentCalls)
maxConcurrentCalls - max concurrent callspublic BulkheadConfig.Builder maxWaitDuration(java.time.Duration maxWaitDuration)
Note: for threads running on an event-loop or equivalent (rx computation pool, etc), setting maxWaitDuration to 0 is highly recommended. Blocking an event-loop thread will most likely have a negative effect on application throughput.
maxWaitDuration - maximum wait time for bulkhead entrypublic BulkheadConfig.Builder writableStackTraceEnabled(boolean writableStackTraceEnabled)
Throwable.getStackTrace()
returns a zero length array. This may be used to reduce log spam when the circuit breaker
is open as the cause of the exceptions is already known (the circuit breaker is
short-circuiting calls).writableStackTraceEnabled - flag to control if stack trace is writablepublic BulkheadConfig.Builder fairCallHandlingStrategyEnabled(boolean fairCallHandlingEnabled)
fairCallHandlingEnabled - flag to choose call handling strategy between fair and unfairpublic BulkheadConfig build()