@Metadata(label="eip,routing,circuitbreaker") public class HystrixConfigurationDefinition extends IdentifiedType
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 |
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().
|
Boolean |
getCircuitBreakerEnabled() |
Integer |
getCircuitBreakerErrorThresholdPercentage() |
Boolean |
getCircuitBreakerForceClosed() |
Boolean |
getCircuitBreakerForceOpen() |
Integer |
getCircuitBreakerRequestVolumeThreshold() |
Integer |
getCircuitBreakerSleepWindowInMilliseconds() |
Integer |
getCorePoolSize() |
Integer |
getExecutionIsolationSemaphoreMaxConcurrentRequests() |
String |
getExecutionIsolationStrategy() |
Boolean |
getExecutionIsolationThreadInterruptOnTimeout() |
Boolean |
getExecutionTimeoutEnabled() |
Integer |
getExecutionTimeoutInMilliseconds() |
Boolean |
getFallbackEnabled() |
Integer |
getFallbackIsolationSemaphoreMaxConcurrentRequests() |
String |
getGroupKey() |
Integer |
getKeepAliveTime() |
Integer |
getMaxQueueSize() |
Integer |
getMetricsHealthSnapshotIntervalInMilliseconds() |
Integer |
getMetricsRollingPercentileBucketSize() |
Boolean |
getMetricsRollingPercentileEnabled() |
Integer |
getMetricsRollingPercentileWindowBuckets() |
Integer |
getMetricsRollingPercentileWindowInMilliseconds() |
Integer |
getMetricsRollingStatisticalWindowBuckets() |
Integer |
getMetricsRollingStatisticalWindowInMilliseconds() |
Integer |
getQueueSizeRejectionThreshold() |
Boolean |
getRequestLogEnabled() |
String |
getThreadPoolKey() |
Integer |
getThreadPoolRollingNumberStatisticalWindowBuckets() |
Integer |
getThreadPoolRollingNumberStatisticalWindowInMilliseconds() |
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 |
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)
Duration of 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 has not been reached. |
HystrixConfigurationDefinition |
requestLogEnabled(Boolean requestLogEnabled)
Whether HystrixCommand execution and events should be logged to HystrixRequestLog.
|
void |
setCircuitBreakerEnabled(Boolean circuitBreakerEnabled) |
void |
setCircuitBreakerErrorThresholdPercentage(Integer circuitBreakerErrorThresholdPercentage) |
void |
setCircuitBreakerForceClosed(Boolean circuitBreakerForceClosed) |
void |
setCircuitBreakerForceOpen(Boolean circuitBreakerForceOpen) |
void |
setCircuitBreakerRequestVolumeThreshold(Integer circuitBreakerRequestVolumeThreshold) |
void |
setCircuitBreakerSleepWindowInMilliseconds(Integer circuitBreakerSleepWindowInMilliseconds) |
void |
setCorePoolSize(Integer corePoolSize) |
void |
setExecutionIsolationSemaphoreMaxConcurrentRequests(Integer executionIsolationSemaphoreMaxConcurrentRequests) |
void |
setExecutionIsolationStrategy(String executionIsolationStrategy) |
void |
setExecutionIsolationThreadInterruptOnTimeout(Boolean executionIsolationThreadInterruptOnTimeout) |
void |
setExecutionTimeoutEnabled(Boolean executionTimeoutEnabled) |
void |
setExecutionTimeoutInMilliseconds(Integer executionTimeoutInMilliseconds) |
void |
setFallbackEnabled(Boolean fallbackEnabled) |
void |
setFallbackIsolationSemaphoreMaxConcurrentRequests(Integer fallbackIsolationSemaphoreMaxConcurrentRequests) |
void |
setGroupKey(String groupKey) |
void |
setKeepAliveTime(Integer keepAliveTime) |
void |
setMaxQueueSize(Integer maxQueueSize) |
void |
setMetricsHealthSnapshotIntervalInMilliseconds(Integer metricsHealthSnapshotIntervalInMilliseconds) |
void |
setMetricsRollingPercentileBucketSize(Integer metricsRollingPercentileBucketSize) |
void |
setMetricsRollingPercentileEnabled(Boolean metricsRollingPercentileEnabled) |
void |
setMetricsRollingPercentileWindowBuckets(Integer metricsRollingPercentileWindowBuckets) |
void |
setMetricsRollingPercentileWindowInMilliseconds(Integer metricsRollingPercentileWindowInMilliseconds) |
void |
setMetricsRollingStatisticalWindowBuckets(Integer metricsRollingStatisticalWindowBuckets) |
void |
setMetricsRollingStatisticalWindowInMilliseconds(Integer metricsRollingStatisticalWindowInMilliseconds) |
void |
setQueueSizeRejectionThreshold(Integer queueSizeRejectionThreshold) |
void |
setRequestLogEnabled(Boolean requestLogEnabled) |
void |
setThreadPoolKey(String threadPoolKey) |
void |
setThreadPoolRollingNumberStatisticalWindowBuckets(Integer threadPoolRollingNumberStatisticalWindowBuckets) |
void |
setThreadPoolRollingNumberStatisticalWindowInMilliseconds(Integer threadPoolRollingNumberStatisticalWindowInMilliseconds) |
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.
|
getId, setId
public static final String DEFAULT_GROUP_KEY
public HystrixConfigurationDefinition()
public HystrixConfigurationDefinition(HystrixDefinition parent)
public String getGroupKey()
public void setGroupKey(String groupKey)
public String getThreadPoolKey()
public void setThreadPoolKey(String threadPoolKey)
public Boolean getCircuitBreakerEnabled()
public void setCircuitBreakerEnabled(Boolean circuitBreakerEnabled)
public Integer getCircuitBreakerErrorThresholdPercentage()
public void setCircuitBreakerErrorThresholdPercentage(Integer circuitBreakerErrorThresholdPercentage)
public Boolean getCircuitBreakerForceClosed()
public void setCircuitBreakerForceClosed(Boolean circuitBreakerForceClosed)
public Boolean getCircuitBreakerForceOpen()
public void setCircuitBreakerForceOpen(Boolean circuitBreakerForceOpen)
public Integer getCircuitBreakerRequestVolumeThreshold()
public void setCircuitBreakerRequestVolumeThreshold(Integer circuitBreakerRequestVolumeThreshold)
public Integer getCircuitBreakerSleepWindowInMilliseconds()
public void setCircuitBreakerSleepWindowInMilliseconds(Integer circuitBreakerSleepWindowInMilliseconds)
public Integer getExecutionIsolationSemaphoreMaxConcurrentRequests()
public void setExecutionIsolationSemaphoreMaxConcurrentRequests(Integer executionIsolationSemaphoreMaxConcurrentRequests)
public String getExecutionIsolationStrategy()
public void setExecutionIsolationStrategy(String executionIsolationStrategy)
public Boolean getExecutionIsolationThreadInterruptOnTimeout()
public void setExecutionIsolationThreadInterruptOnTimeout(Boolean executionIsolationThreadInterruptOnTimeout)
public Integer getExecutionTimeoutInMilliseconds()
public void setExecutionTimeoutInMilliseconds(Integer executionTimeoutInMilliseconds)
public Boolean getExecutionTimeoutEnabled()
public void setExecutionTimeoutEnabled(Boolean executionTimeoutEnabled)
public Integer getFallbackIsolationSemaphoreMaxConcurrentRequests()
public void setFallbackIsolationSemaphoreMaxConcurrentRequests(Integer fallbackIsolationSemaphoreMaxConcurrentRequests)
public Boolean getFallbackEnabled()
public void setFallbackEnabled(Boolean fallbackEnabled)
public Integer getMetricsHealthSnapshotIntervalInMilliseconds()
public void setMetricsHealthSnapshotIntervalInMilliseconds(Integer metricsHealthSnapshotIntervalInMilliseconds)
public Integer getMetricsRollingPercentileBucketSize()
public void setMetricsRollingPercentileBucketSize(Integer metricsRollingPercentileBucketSize)
public Boolean getMetricsRollingPercentileEnabled()
public void setMetricsRollingPercentileEnabled(Boolean metricsRollingPercentileEnabled)
public Integer getMetricsRollingPercentileWindowInMilliseconds()
public void setMetricsRollingPercentileWindowInMilliseconds(Integer metricsRollingPercentileWindowInMilliseconds)
public Integer getMetricsRollingPercentileWindowBuckets()
public void setMetricsRollingPercentileWindowBuckets(Integer metricsRollingPercentileWindowBuckets)
public Integer getMetricsRollingStatisticalWindowInMilliseconds()
public void setMetricsRollingStatisticalWindowInMilliseconds(Integer metricsRollingStatisticalWindowInMilliseconds)
public Integer getMetricsRollingStatisticalWindowBuckets()
public void setMetricsRollingStatisticalWindowBuckets(Integer metricsRollingStatisticalWindowBuckets)
public Boolean getRequestLogEnabled()
public void setRequestLogEnabled(Boolean requestLogEnabled)
public Integer getCorePoolSize()
public void setCorePoolSize(Integer corePoolSize)
public Integer getKeepAliveTime()
public void setKeepAliveTime(Integer keepAliveTime)
public Integer getMaxQueueSize()
public void setMaxQueueSize(Integer maxQueueSize)
public Integer getQueueSizeRejectionThreshold()
public void setQueueSizeRejectionThreshold(Integer queueSizeRejectionThreshold)
public Integer getThreadPoolRollingNumberStatisticalWindowInMilliseconds()
public void setThreadPoolRollingNumberStatisticalWindowInMilliseconds(Integer threadPoolRollingNumberStatisticalWindowInMilliseconds)
public Integer getThreadPoolRollingNumberStatisticalWindowBuckets()
public void setThreadPoolRollingNumberStatisticalWindowBuckets(Integer threadPoolRollingNumberStatisticalWindowBuckets)
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
== 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 queueSizeRejectionThreshold(Integer queueSizeRejectionThreshold)
maxQueueSize
has not been reached. This is done because the maxQueueSize
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 HystrixDefinition end()
Apache Camel