@Metadata(label="eip,routing,circuitbreaker") public class HystrixConfigurationDefinition extends HystrixConfigurationCommon
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_GROUP_KEY |
Constructor and Description |
---|
HystrixConfigurationDefinition() |
HystrixConfigurationDefinition(HystrixDefinition parent) |
Modifier and Type | Method and Description |
---|---|
HystrixConfigurationDefinition |
allowMaximumSizeToDivergeFromCoreSize(Boolean allowMaximumSizeToDivergeFromCoreSize)
Allows the configuration for maximumSize to take effect.
|
HystrixConfigurationDefinition |
circuitBreakerEnabled(Boolean circuitBreakerEnabled)
Whether to use a HystrixCircuitBreaker or not.
|
HystrixConfigurationDefinition |
circuitBreakerErrorThresholdPercentage(Integer circuitBreakerErrorThresholdPercentage)
Error percentage threshold (as whole number such as 50) at which point the circuit breaker will trip open and reject requests.
|
HystrixConfigurationDefinition |
circuitBreakerForceClosed(Boolean circuitBreakerForceClosed)
If true the HystrixCircuitBreaker#allowRequest() will always return true to allow requests regardless of
the error percentage from HystrixCommandMetrics.getHealthCounts().
|
HystrixConfigurationDefinition |
circuitBreakerForceOpen(Boolean circuitBreakerForceOpen)
If true the HystrixCircuitBreaker.allowRequest() will always return false, causing the circuit to be open (tripped) and reject all requests.
|
HystrixConfigurationDefinition |
circuitBreakerRequestVolumeThreshold(Integer circuitBreakerRequestVolumeThreshold)
Minimum number of requests in the metricsRollingStatisticalWindowInMilliseconds() that must exist before the HystrixCircuitBreaker will trip.
|
HystrixConfigurationDefinition |
circuitBreakerSleepWindowInMilliseconds(Integer circuitBreakerSleepWindowInMilliseconds)
The time in milliseconds after a HystrixCircuitBreaker trips open that it should wait before trying requests again.
|
HystrixConfigurationDefinition |
corePoolSize(Integer corePoolSize)
Core thread-pool size that gets passed to
ThreadPoolExecutor.setCorePoolSize(int) |
HystrixDefinition |
end()
End of configuration
|
HystrixConfigurationDefinition |
executionIsolationSemaphoreMaxConcurrentRequests(Integer executionIsolationSemaphoreMaxConcurrentRequests)
Number of concurrent requests permitted to HystrixCommand.run().
|
HystrixConfigurationDefinition |
executionIsolationStrategy(String executionIsolationStrategy)
What isolation strategy HystrixCommand.run() will be executed with.
|
HystrixConfigurationDefinition |
executionIsolationThreadInterruptOnTimeout(Boolean executionIsolationThreadInterruptOnTimeout)
Whether the execution thread should attempt an interrupt (using
Future.cancel(boolean) ) when a thread times out. |
HystrixConfigurationDefinition |
executionTimeoutEnabled(Boolean executionTimeoutEnabled)
Whether the timeout mechanism is enabled for this command
|
HystrixConfigurationDefinition |
executionTimeoutInMilliseconds(Integer executionTimeoutInMilliseconds)
Time in milliseconds at which point the command will timeout and halt execution.
|
HystrixConfigurationDefinition |
fallbackEnabled(Boolean fallbackEnabled)
Whether HystrixCommand.getFallback() should be attempted when failure occurs.
|
HystrixConfigurationDefinition |
fallbackIsolationSemaphoreMaxConcurrentRequests(Integer fallbackIsolationSemaphoreMaxConcurrentRequests)
Number of concurrent requests permitted to HystrixCommand.getFallback().
|
HystrixConfigurationDefinition |
groupKey(String groupKey)
Sets the group key to use.
|
HystrixConfigurationDefinition |
keepAliveTime(Integer keepAliveTime)
Keep-alive time in minutes that gets passed to
ThreadPoolExecutor.setKeepAliveTime(long, TimeUnit) |
HystrixConfigurationDefinition |
maximumSize(Integer maximumSize)
Maximum thread-pool size that gets passed to
ThreadPoolExecutor.setMaximumPoolSize(int) . |
HystrixConfigurationDefinition |
maxQueueSize(Integer maxQueueSize)
Max queue size that gets passed to
BlockingQueue in HystrixConcurrencyStrategy.getBlockingQueue(int)
This should only affect the instantiation of a threadpool - it is not eliglible to change a queue size on the fly. |
HystrixConfigurationDefinition |
metricsHealthSnapshotIntervalInMilliseconds(Integer metricsHealthSnapshotIntervalInMilliseconds)
Time in milliseconds to wait between allowing health snapshots to be taken that calculate success and error
percentages and affect HystrixCircuitBreaker.isOpen() status.
|
HystrixConfigurationDefinition |
metricsRollingPercentileBucketSize(Integer metricsRollingPercentileBucketSize)
Maximum number of values stored in each bucket of the rolling percentile.
|
HystrixConfigurationDefinition |
metricsRollingPercentileEnabled(Boolean metricsRollingPercentileEnabled)
Whether percentile metrics should be captured using HystrixRollingPercentile inside HystrixCommandMetrics.
|
HystrixConfigurationDefinition |
metricsRollingPercentileWindowBuckets(Integer metricsRollingPercentileWindowBuckets)
Number of buckets the rolling percentile window is broken into.
|
HystrixConfigurationDefinition |
metricsRollingPercentileWindowInMilliseconds(Integer metricsRollingPercentileWindowInMilliseconds)
Duration of percentile rolling window in milliseconds.
|
HystrixConfigurationDefinition |
metricsRollingStatisticalWindowBuckets(Integer metricsRollingStatisticalWindowBuckets)
Number of buckets the rolling statistical window is broken into.
|
HystrixConfigurationDefinition |
metricsRollingStatisticalWindowInMilliseconds(Integer metricsRollingStatisticalWindowInMilliseconds)
This property sets the duration of the statistical rolling window, in milliseconds.
|
HystrixConfigurationDefinition |
queueSizeRejectionThreshold(Integer queueSizeRejectionThreshold)
Queue size rejection threshold is an artificial "max" size at which rejections will occur even
if
maxQueueSize(java.lang.Integer) has not been reached. |
HystrixConfigurationDefinition |
requestLogEnabled(Boolean requestLogEnabled)
Whether HystrixCommand execution and events should be logged to HystrixRequestLog.
|
HystrixConfigurationDefinition |
threadPoolKey(String threadPoolKey)
Sets the thread pool key to use.
|
HystrixConfigurationDefinition |
threadPoolRollingNumberStatisticalWindowBuckets(Integer threadPoolRollingNumberStatisticalWindowBuckets)
Number of buckets the rolling statistical window is broken into.
|
HystrixConfigurationDefinition |
threadPoolRollingNumberStatisticalWindowInMilliseconds(Integer threadPoolRollingNumberStatisticalWindowInMilliseconds)
Duration of statistical rolling window in milliseconds.
|
getAllowMaximumSizeToDivergeFromCoreSize, getCircuitBreakerEnabled, getCircuitBreakerErrorThresholdPercentage, getCircuitBreakerForceClosed, getCircuitBreakerForceOpen, getCircuitBreakerRequestVolumeThreshold, getCircuitBreakerSleepWindowInMilliseconds, getCorePoolSize, getExecutionIsolationSemaphoreMaxConcurrentRequests, getExecutionIsolationStrategy, getExecutionIsolationThreadInterruptOnTimeout, getExecutionTimeoutEnabled, getExecutionTimeoutInMilliseconds, getFallbackEnabled, getFallbackIsolationSemaphoreMaxConcurrentRequests, getGroupKey, getKeepAliveTime, getMaximumSize, getMaxQueueSize, getMetricsHealthSnapshotIntervalInMilliseconds, getMetricsRollingPercentileBucketSize, getMetricsRollingPercentileEnabled, getMetricsRollingPercentileWindowBuckets, getMetricsRollingPercentileWindowInMilliseconds, getMetricsRollingStatisticalWindowBuckets, getMetricsRollingStatisticalWindowInMilliseconds, getQueueSizeRejectionThreshold, getRequestLogEnabled, getThreadPoolKey, getThreadPoolRollingNumberStatisticalWindowBuckets, getThreadPoolRollingNumberStatisticalWindowInMilliseconds, setAllowMaximumSizeToDivergeFromCoreSize, setCircuitBreakerEnabled, setCircuitBreakerErrorThresholdPercentage, setCircuitBreakerForceClosed, setCircuitBreakerForceOpen, setCircuitBreakerRequestVolumeThreshold, setCircuitBreakerSleepWindowInMilliseconds, setCorePoolSize, setExecutionIsolationSemaphoreMaxConcurrentRequests, setExecutionIsolationStrategy, setExecutionIsolationThreadInterruptOnTimeout, setExecutionTimeoutEnabled, setExecutionTimeoutInMilliseconds, setFallbackEnabled, setFallbackIsolationSemaphoreMaxConcurrentRequests, setGroupKey, setKeepAliveTime, setMaximumSize, setMaxQueueSize, setMetricsHealthSnapshotIntervalInMilliseconds, setMetricsRollingPercentileBucketSize, setMetricsRollingPercentileEnabled, setMetricsRollingPercentileWindowBuckets, setMetricsRollingPercentileWindowInMilliseconds, setMetricsRollingStatisticalWindowBuckets, setMetricsRollingStatisticalWindowInMilliseconds, setQueueSizeRejectionThreshold, setRequestLogEnabled, setThreadPoolKey, setThreadPoolRollingNumberStatisticalWindowBuckets, setThreadPoolRollingNumberStatisticalWindowInMilliseconds
getId, setId
public static final String DEFAULT_GROUP_KEY
public HystrixConfigurationDefinition()
public HystrixConfigurationDefinition(HystrixDefinition parent)
public HystrixConfigurationDefinition groupKey(String groupKey)
public HystrixConfigurationDefinition threadPoolKey(String threadPoolKey)
public HystrixConfigurationDefinition circuitBreakerEnabled(Boolean circuitBreakerEnabled)
This is similar in effect to circuitBreakerForceClosed() except that continues tracking metrics and knowing whether it should be open/closed, this property results in not even instantiating a circuit-breaker.
public HystrixConfigurationDefinition circuitBreakerErrorThresholdPercentage(Integer circuitBreakerErrorThresholdPercentage)
It will stay tripped for the duration defined in circuitBreakerSleepWindowInMilliseconds;
The error percentage this is compared against comes from HystrixCommandMetrics.getHealthCounts().
public HystrixConfigurationDefinition circuitBreakerForceClosed(Boolean circuitBreakerForceClosed)
The circuitBreakerForceOpen() property takes precedence so if it set to true this property does nothing.
public HystrixConfigurationDefinition circuitBreakerForceOpen(Boolean circuitBreakerForceOpen)
This property takes precedence over circuitBreakerForceClosed();
public HystrixConfigurationDefinition circuitBreakerRequestVolumeThreshold(Integer circuitBreakerRequestVolumeThreshold)
If below this number the circuit will not trip regardless of error percentage.
public HystrixConfigurationDefinition circuitBreakerSleepWindowInMilliseconds(Integer circuitBreakerSleepWindowInMilliseconds)
public HystrixConfigurationDefinition executionIsolationSemaphoreMaxConcurrentRequests(Integer executionIsolationSemaphoreMaxConcurrentRequests)
Applicable only when executionIsolationStrategy == SEMAPHORE.
public HystrixConfigurationDefinition executionIsolationStrategy(String executionIsolationStrategy)
If THREAD then it will be executed on a separate thread and concurrent requests limited by the number of threads in the thread-pool.
If SEMAPHORE then it will be executed on the calling thread and concurrent requests limited by the semaphore count.
public HystrixConfigurationDefinition executionIsolationThreadInterruptOnTimeout(Boolean executionIsolationThreadInterruptOnTimeout)
Future.cancel(boolean)
) when a thread times out.
Applicable only when executionIsolationStrategy() == THREAD.
public HystrixConfigurationDefinition executionTimeoutInMilliseconds(Integer executionTimeoutInMilliseconds)
If executionIsolationThreadInterruptOnTimeout(java.lang.Boolean)
== true and the command is thread-isolated, the executing thread will be interrupted.
If the command is semaphore-isolated and a HystrixObservableCommand, that command will get unsubscribed.
public HystrixConfigurationDefinition executionTimeoutEnabled(Boolean executionTimeoutEnabled)
public HystrixConfigurationDefinition fallbackIsolationSemaphoreMaxConcurrentRequests(Integer fallbackIsolationSemaphoreMaxConcurrentRequests)
public HystrixConfigurationDefinition fallbackEnabled(Boolean fallbackEnabled)
public HystrixConfigurationDefinition metricsHealthSnapshotIntervalInMilliseconds(Integer metricsHealthSnapshotIntervalInMilliseconds)
On high-volume circuits the continual calculation of error percentage can become CPU intensive thus this controls how often it is calculated.
public HystrixConfigurationDefinition metricsRollingPercentileBucketSize(Integer metricsRollingPercentileBucketSize)
public HystrixConfigurationDefinition metricsRollingPercentileEnabled(Boolean metricsRollingPercentileEnabled)
public HystrixConfigurationDefinition metricsRollingPercentileWindowInMilliseconds(Integer metricsRollingPercentileWindowInMilliseconds)
public HystrixConfigurationDefinition metricsRollingPercentileWindowBuckets(Integer metricsRollingPercentileWindowBuckets)
public HystrixConfigurationDefinition metricsRollingStatisticalWindowInMilliseconds(Integer metricsRollingStatisticalWindowInMilliseconds)
public HystrixConfigurationDefinition metricsRollingStatisticalWindowBuckets(Integer metricsRollingStatisticalWindowBuckets)
public HystrixConfigurationDefinition requestLogEnabled(Boolean requestLogEnabled)
public HystrixConfigurationDefinition corePoolSize(Integer corePoolSize)
ThreadPoolExecutor.setCorePoolSize(int)
public HystrixConfigurationDefinition keepAliveTime(Integer keepAliveTime)
ThreadPoolExecutor.setKeepAliveTime(long, TimeUnit)
public HystrixConfigurationDefinition maxQueueSize(Integer maxQueueSize)
BlockingQueue
in HystrixConcurrencyStrategy.getBlockingQueue(int)
This should only affect the instantiation of a threadpool - it is not eliglible to change a queue size on the fly.
For that, use queueSizeRejectionThreshold().public HystrixConfigurationDefinition maximumSize(Integer maximumSize)
ThreadPoolExecutor.setMaximumPoolSize(int)
.
This is the maximum amount of concurrency that can be supported without starting to reject HystrixCommands.
Please note that this setting only takes effect if you also set allowMaximumSizeToDivergeFromCoreSizepublic HystrixConfigurationDefinition queueSizeRejectionThreshold(Integer queueSizeRejectionThreshold)
maxQueueSize(java.lang.Integer)
has not been reached. This is done because the maxQueueSize(java.lang.Integer)
of a BlockingQueue
can not be dynamically changed and we want to support dynamically
changing the queue size that affects rejections.
This is used by HystrixCommand when queuing a thread for execution.
public HystrixConfigurationDefinition threadPoolRollingNumberStatisticalWindowInMilliseconds(Integer threadPoolRollingNumberStatisticalWindowInMilliseconds)
public HystrixConfigurationDefinition threadPoolRollingNumberStatisticalWindowBuckets(Integer threadPoolRollingNumberStatisticalWindowBuckets)
public HystrixConfigurationDefinition allowMaximumSizeToDivergeFromCoreSize(Boolean allowMaximumSizeToDivergeFromCoreSize)
public HystrixDefinition end()
Apache Camel