public class HystrixConfigurationCommon extends IdentifiedType
Constructor and Description |
---|
HystrixConfigurationCommon() |
Modifier and Type | Method and Description |
---|---|
Boolean |
getAllowMaximumSizeToDivergeFromCoreSize() |
Boolean |
getCircuitBreakerEnabled() |
String |
getCircuitBreakerErrorThresholdPercentage() |
Boolean |
getCircuitBreakerForceClosed() |
Boolean |
getCircuitBreakerForceOpen() |
String |
getCircuitBreakerRequestVolumeThreshold() |
String |
getCircuitBreakerSleepWindowInMilliseconds() |
String |
getCorePoolSize() |
String |
getExecutionIsolationSemaphoreMaxConcurrentRequests() |
String |
getExecutionIsolationStrategy() |
Boolean |
getExecutionIsolationThreadInterruptOnTimeout() |
Boolean |
getExecutionTimeoutEnabled() |
String |
getExecutionTimeoutInMilliseconds() |
Boolean |
getFallbackEnabled() |
String |
getFallbackIsolationSemaphoreMaxConcurrentRequests() |
String |
getGroupKey() |
String |
getKeepAliveTime() |
String |
getMaximumSize() |
String |
getMaxQueueSize() |
String |
getMetricsHealthSnapshotIntervalInMilliseconds() |
String |
getMetricsRollingPercentileBucketSize() |
Boolean |
getMetricsRollingPercentileEnabled() |
String |
getMetricsRollingPercentileWindowBuckets() |
String |
getMetricsRollingPercentileWindowInMilliseconds() |
String |
getMetricsRollingStatisticalWindowBuckets() |
String |
getMetricsRollingStatisticalWindowInMilliseconds() |
String |
getQueueSizeRejectionThreshold() |
Boolean |
getRequestLogEnabled() |
String |
getThreadPoolKey() |
String |
getThreadPoolRollingNumberStatisticalWindowBuckets() |
String |
getThreadPoolRollingNumberStatisticalWindowInMilliseconds() |
void |
setAllowMaximumSizeToDivergeFromCoreSize(Boolean allowMaximumSizeToDivergeFromCoreSize)
Allows the configuration for maximumSize to take effect.
|
void |
setCircuitBreakerEnabled(Boolean circuitBreakerEnabled)
Whether to use a HystrixCircuitBreaker or not.
|
void |
setCircuitBreakerErrorThresholdPercentage(Integer circuitBreakerErrorThresholdPercentage)
Error percentage threshold (as whole number such as 50) at which point the circuit breaker will trip open and reject requests.
|
void |
setCircuitBreakerErrorThresholdPercentage(String circuitBreakerErrorThresholdPercentage)
The value can be a property placeholder
|
void |
setCircuitBreakerForceClosed(Boolean circuitBreakerForceClosed)
If true the HystrixCircuitBreaker#allowRequest() will always return true to allow requests regardless of
the error percentage from HystrixCommandMetrics.getHealthCounts().
|
void |
setCircuitBreakerForceOpen(Boolean circuitBreakerForceOpen)
If true the HystrixCircuitBreaker.allowRequest() will always return false, causing the circuit to be open (tripped) and reject all requests.
|
void |
setCircuitBreakerRequestVolumeThreshold(Integer circuitBreakerRequestVolumeThreshold)
Minimum number of requests in the metricsRollingStatisticalWindowInMilliseconds() that must exist before the HystrixCircuitBreaker will trip.
|
void |
setCircuitBreakerRequestVolumeThreshold(String circuitBreakerRequestVolumeThreshold)
The value can be a property placeholder
|
void |
setCircuitBreakerSleepWindowInMilliseconds(Integer circuitBreakerSleepWindowInMilliseconds)
The time in milliseconds after a HystrixCircuitBreaker trips open that it should wait before trying requests again.
|
void |
setCircuitBreakerSleepWindowInMilliseconds(String circuitBreakerSleepWindowInMilliseconds)
The value can be a property placeholder
|
void |
setCorePoolSize(Integer corePoolSize)
The value can be a property placeholder
|
void |
setCorePoolSize(String corePoolSize)
Core thread-pool size that gets passed to
ThreadPoolExecutor.setCorePoolSize(int) |
void |
setExecutionIsolationSemaphoreMaxConcurrentRequests(Integer executionIsolationSemaphoreMaxConcurrentRequests)
Number of concurrent requests permitted to HystrixCommand.run().
|
void |
setExecutionIsolationSemaphoreMaxConcurrentRequests(String executionIsolationSemaphoreMaxConcurrentRequests)
The value can be a property placeholder
|
void |
setExecutionIsolationStrategy(String executionIsolationStrategy)
What isolation strategy HystrixCommand.run() will be executed with.
|
void |
setExecutionIsolationThreadInterruptOnTimeout(Boolean executionIsolationThreadInterruptOnTimeout)
Whether the execution thread should attempt an interrupt (using
Future.cancel(boolean) ) when a thread times out. |
void |
setExecutionTimeoutEnabled(Boolean executionTimeoutEnabled)
Whether the timeout mechanism is enabled for this command
|
void |
setExecutionTimeoutInMilliseconds(Integer executionTimeoutInMilliseconds)
Time in milliseconds at which point the command will timeout and halt execution.
|
void |
setExecutionTimeoutInMilliseconds(String executionTimeoutInMilliseconds)
The value can be a property placeholder
|
void |
setFallbackEnabled(Boolean fallbackEnabled)
Whether HystrixCommand.getFallback() should be attempted when failure occurs.
|
void |
setFallbackIsolationSemaphoreMaxConcurrentRequests(Integer fallbackIsolationSemaphoreMaxConcurrentRequests)
Number of concurrent requests permitted to HystrixCommand.getFallback().
|
void |
setFallbackIsolationSemaphoreMaxConcurrentRequests(String fallbackIsolationSemaphoreMaxConcurrentRequests)
The value can be a property placeholder
|
void |
setGroupKey(String groupKey)
Sets the group key to use.
|
void |
setKeepAliveTime(Integer keepAliveTime)
Keep-alive time in minutes that gets passed to
ThreadPoolExecutor.setKeepAliveTime(long, TimeUnit) |
void |
setKeepAliveTime(String keepAliveTime)
The value can be a property placeholder
|
void |
setMaximumSize(Integer maximumSize)
Maximum thread-pool size that gets passed to
ThreadPoolExecutor.setMaximumPoolSize(int) . |
void |
setMaximumSize(String maximumSize)
The value can be a property placeholder
|
void |
setMaxQueueSize(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. |
void |
setMaxQueueSize(String maxQueueSize)
The value can be a property placeholder
|
void |
setMetricsHealthSnapshotIntervalInMilliseconds(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.
|
void |
setMetricsHealthSnapshotIntervalInMilliseconds(String metricsHealthSnapshotIntervalInMilliseconds)
The value can be a property placeholder
|
void |
setMetricsRollingPercentileBucketSize(Integer metricsRollingPercentileBucketSize)
Maximum number of values stored in each bucket of the rolling percentile.
|
void |
setMetricsRollingPercentileBucketSize(String metricsRollingPercentileBucketSize)
The value can be a property placeholder
|
void |
setMetricsRollingPercentileEnabled(Boolean metricsRollingPercentileEnabled)
Whether percentile metrics should be captured using HystrixRollingPercentile inside HystrixCommandMetrics.
|
void |
setMetricsRollingPercentileWindowBuckets(Integer metricsRollingPercentileWindowBuckets)
Number of buckets the rolling percentile window is broken into.
|
void |
setMetricsRollingPercentileWindowBuckets(String metricsRollingPercentileWindowBuckets)
The value can be a property placeholder
|
void |
setMetricsRollingPercentileWindowInMilliseconds(Integer metricsRollingPercentileWindowInMilliseconds)
Duration of percentile rolling window in milliseconds.
|
void |
setMetricsRollingPercentileWindowInMilliseconds(String metricsRollingPercentileWindowInMilliseconds)
The value can be a property placeholder
|
void |
setMetricsRollingStatisticalWindowBuckets(Integer metricsRollingStatisticalWindowBuckets)
Number of buckets the rolling statistical window is broken into.
|
void |
setMetricsRollingStatisticalWindowBuckets(String metricsRollingStatisticalWindowBuckets)
The value can be a property placeholder
|
void |
setMetricsRollingStatisticalWindowInMilliseconds(Integer metricsRollingStatisticalWindowInMilliseconds)
This property sets the duration of the statistical rolling window, in milliseconds.
|
void |
setMetricsRollingStatisticalWindowInMilliseconds(String metricsRollingStatisticalWindowInMilliseconds)
The value can be a property placeholder
|
void |
setQueueSizeRejectionThreshold(Integer queueSizeRejectionThreshold)
Queue size rejection threshold is an artificial "max" size at which rejections will occur even
if
maxQueueSize has not been reached. |
void |
setQueueSizeRejectionThreshold(String queueSizeRejectionThreshold)
The value can be a property placeholder
|
void |
setRequestLogEnabled(Boolean requestLogEnabled)
Whether HystrixCommand execution and events should be logged to HystrixRequestLog.
|
void |
setThreadPoolKey(String threadPoolKey)
Sets the thread pool key to use.
|
void |
setThreadPoolRollingNumberStatisticalWindowBuckets(Integer threadPoolRollingNumberStatisticalWindowBuckets)
Number of buckets the rolling statistical window is broken into.
|
void |
setThreadPoolRollingNumberStatisticalWindowBuckets(String threadPoolRollingNumberStatisticalWindowBuckets)
The value can be a property placeholder
|
void |
setThreadPoolRollingNumberStatisticalWindowInMilliseconds(Integer threadPoolRollingNumberStatisticalWindowInMilliseconds)
Duration of statistical rolling window in milliseconds.
|
void |
setThreadPoolRollingNumberStatisticalWindowInMilliseconds(String threadPoolRollingNumberStatisticalWindowInMilliseconds)
The value can be a property placeholder
|
getId, setId
public HystrixConfigurationCommon()
public String getGroupKey()
public void setGroupKey(String groupKey)
public String getThreadPoolKey()
public void setThreadPoolKey(String threadPoolKey)
public Boolean getCircuitBreakerEnabled()
public void setCircuitBreakerEnabled(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 String getCircuitBreakerErrorThresholdPercentage()
public void setCircuitBreakerErrorThresholdPercentage(Integer circuitBreakerErrorThresholdPercentage)
It will stay tripped for the duration defined in circuitBreakerSleepWindowInMilliseconds;
The error percentage this is compared against comes from HystrixCommandMetrics.getHealthCounts().
public void setCircuitBreakerErrorThresholdPercentage(String circuitBreakerErrorThresholdPercentage)
public Boolean getCircuitBreakerForceClosed()
public void setCircuitBreakerForceClosed(Boolean circuitBreakerForceClosed)
The circuitBreakerForceOpen() property takes precedence so if it set to true this property does nothing.
public Boolean getCircuitBreakerForceOpen()
public void setCircuitBreakerForceOpen(Boolean circuitBreakerForceOpen)
This property takes precedence over circuitBreakerForceClosed();
public String getCircuitBreakerRequestVolumeThreshold()
public void setCircuitBreakerRequestVolumeThreshold(Integer circuitBreakerRequestVolumeThreshold)
If below this number the circuit will not trip regardless of error percentage.
public void setCircuitBreakerRequestVolumeThreshold(String circuitBreakerRequestVolumeThreshold)
public String getCircuitBreakerSleepWindowInMilliseconds()
public void setCircuitBreakerSleepWindowInMilliseconds(Integer circuitBreakerSleepWindowInMilliseconds)
public void setCircuitBreakerSleepWindowInMilliseconds(String circuitBreakerSleepWindowInMilliseconds)
public String getExecutionIsolationSemaphoreMaxConcurrentRequests()
public void setExecutionIsolationSemaphoreMaxConcurrentRequests(Integer executionIsolationSemaphoreMaxConcurrentRequests)
Applicable only when executionIsolationStrategy == SEMAPHORE.
public void setExecutionIsolationSemaphoreMaxConcurrentRequests(String executionIsolationSemaphoreMaxConcurrentRequests)
public String getExecutionIsolationStrategy()
public void setExecutionIsolationStrategy(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 Boolean getExecutionIsolationThreadInterruptOnTimeout()
public void setExecutionIsolationThreadInterruptOnTimeout(Boolean executionIsolationThreadInterruptOnTimeout)
Future.cancel(boolean)
) when a thread times out.
Applicable only when executionIsolationStrategy() == THREAD.
public String getExecutionTimeoutInMilliseconds()
public void setExecutionTimeoutInMilliseconds(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 void setExecutionTimeoutInMilliseconds(String executionTimeoutInMilliseconds)
public Boolean getExecutionTimeoutEnabled()
public void setExecutionTimeoutEnabled(Boolean executionTimeoutEnabled)
public String getFallbackIsolationSemaphoreMaxConcurrentRequests()
public void setFallbackIsolationSemaphoreMaxConcurrentRequests(Integer fallbackIsolationSemaphoreMaxConcurrentRequests)
public void setFallbackIsolationSemaphoreMaxConcurrentRequests(String fallbackIsolationSemaphoreMaxConcurrentRequests)
public Boolean getFallbackEnabled()
public void setFallbackEnabled(Boolean fallbackEnabled)
public String getMetricsHealthSnapshotIntervalInMilliseconds()
public void setMetricsHealthSnapshotIntervalInMilliseconds(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 void setMetricsHealthSnapshotIntervalInMilliseconds(String metricsHealthSnapshotIntervalInMilliseconds)
public String getMetricsRollingPercentileBucketSize()
public void setMetricsRollingPercentileBucketSize(Integer metricsRollingPercentileBucketSize)
public void setMetricsRollingPercentileBucketSize(String metricsRollingPercentileBucketSize)
public Boolean getMetricsRollingPercentileEnabled()
public void setMetricsRollingPercentileEnabled(Boolean metricsRollingPercentileEnabled)
public String getMetricsRollingPercentileWindowInMilliseconds()
public void setMetricsRollingPercentileWindowInMilliseconds(Integer metricsRollingPercentileWindowInMilliseconds)
public void setMetricsRollingPercentileWindowInMilliseconds(String metricsRollingPercentileWindowInMilliseconds)
public String getMetricsRollingPercentileWindowBuckets()
public void setMetricsRollingPercentileWindowBuckets(Integer metricsRollingPercentileWindowBuckets)
public void setMetricsRollingPercentileWindowBuckets(String metricsRollingPercentileWindowBuckets)
public String getMetricsRollingStatisticalWindowInMilliseconds()
public void setMetricsRollingStatisticalWindowInMilliseconds(Integer metricsRollingStatisticalWindowInMilliseconds)
public void setMetricsRollingStatisticalWindowInMilliseconds(String metricsRollingStatisticalWindowInMilliseconds)
public String getMetricsRollingStatisticalWindowBuckets()
public void setMetricsRollingStatisticalWindowBuckets(Integer metricsRollingStatisticalWindowBuckets)
public void setMetricsRollingStatisticalWindowBuckets(String metricsRollingStatisticalWindowBuckets)
public Boolean getRequestLogEnabled()
public void setRequestLogEnabled(Boolean requestLogEnabled)
public String getCorePoolSize()
public void setCorePoolSize(String corePoolSize)
ThreadPoolExecutor.setCorePoolSize(int)
public void setCorePoolSize(Integer corePoolSize)
public String getMaximumSize()
public void setMaximumSize(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 void setMaximumSize(String maximumSize)
public String getKeepAliveTime()
public void setKeepAliveTime(Integer keepAliveTime)
ThreadPoolExecutor.setKeepAliveTime(long, TimeUnit)
public void setKeepAliveTime(String keepAliveTime)
public String getMaxQueueSize()
public void setMaxQueueSize(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 void setMaxQueueSize(String maxQueueSize)
public String getQueueSizeRejectionThreshold()
public void setQueueSizeRejectionThreshold(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 void setQueueSizeRejectionThreshold(String queueSizeRejectionThreshold)
public String getThreadPoolRollingNumberStatisticalWindowInMilliseconds()
public void setThreadPoolRollingNumberStatisticalWindowInMilliseconds(Integer threadPoolRollingNumberStatisticalWindowInMilliseconds)
public void setThreadPoolRollingNumberStatisticalWindowInMilliseconds(String threadPoolRollingNumberStatisticalWindowInMilliseconds)
public String getThreadPoolRollingNumberStatisticalWindowBuckets()
public void setThreadPoolRollingNumberStatisticalWindowBuckets(Integer threadPoolRollingNumberStatisticalWindowBuckets)
public void setThreadPoolRollingNumberStatisticalWindowBuckets(String threadPoolRollingNumberStatisticalWindowBuckets)
public Boolean getAllowMaximumSizeToDivergeFromCoreSize()
public void setAllowMaximumSizeToDivergeFromCoreSize(Boolean allowMaximumSizeToDivergeFromCoreSize)
Apache Camel