public abstract class HystrixCommandProperties
extends java.lang.Object
HystrixCommand
.
Default implementation of methods uses Archaius (https://github.com/Netflix/archaius)
Modifier and Type | Class and Description |
---|---|
static class |
HystrixCommandProperties.ExecutionIsolationStrategy
Isolation strategy to use when executing a
HystrixCommand . |
static class |
HystrixCommandProperties.Setter
Fluent interface that allows chained setting of properties that can be passed into a
HystrixCommand constructor to inject instance specific property overrides. |
Modifier | Constructor and Description |
---|---|
protected |
HystrixCommandProperties(HystrixCommandKey key) |
protected |
HystrixCommandProperties(HystrixCommandKey key,
HystrixCommandProperties.Setter builder) |
protected |
HystrixCommandProperties(HystrixCommandKey key,
HystrixCommandProperties.Setter builder,
java.lang.String propertyPrefix) |
Modifier and Type | Method and Description |
---|---|
HystrixProperty<java.lang.Boolean> |
circuitBreakerEnabled()
Whether to use a
HystrixCircuitBreaker or not. |
HystrixProperty<java.lang.Integer> |
circuitBreakerErrorThresholdPercentage()
Error percentage threshold (as whole number such as 50) at which point the circuit breaker will trip open and reject requests.
|
HystrixProperty<java.lang.Boolean> |
circuitBreakerForceClosed()
If true the
HystrixCircuitBreaker.allowRequest() will always return true to allow requests regardless of the error percentage from HystrixCommandMetrics.getHealthCounts() . |
HystrixProperty<java.lang.Boolean> |
circuitBreakerForceOpen()
If true the
HystrixCircuitBreaker.allowRequest() will always return false, causing the circuit to be open (tripped) and reject all requests. |
HystrixProperty<java.lang.Integer> |
circuitBreakerRequestVolumeThreshold()
Minimum number of requests in the
metricsRollingStatisticalWindowInMilliseconds() that must exist before the HystrixCircuitBreaker will trip. |
HystrixProperty<java.lang.Integer> |
circuitBreakerSleepWindowInMilliseconds()
The time in milliseconds after a
HystrixCircuitBreaker trips open that it should wait before trying requests again. |
static HystrixCommandProperties.Setter |
defaultSetter()
Factory method to retrieve the default Setter.
|
HystrixProperty<java.lang.Integer> |
executionIsolationSemaphoreMaxConcurrentRequests()
Number of concurrent requests permitted to
HystrixCommand.run() . |
HystrixProperty<HystrixCommandProperties.ExecutionIsolationStrategy> |
executionIsolationStrategy()
What isolation strategy
HystrixCommand.run() will be executed with. |
HystrixProperty<java.lang.Boolean> |
executionIsolationThreadInterruptOnTimeout()
Whether the execution thread should attempt an interrupt (using
Future.cancel(boolean) ) when a thread times out. |
HystrixProperty<java.lang.String> |
executionIsolationThreadPoolKeyOverride()
Allow a dynamic override of the
HystrixThreadPoolKey that will dynamically change which HystrixThreadPool a HystrixCommand executes on. |
HystrixProperty<java.lang.Integer> |
executionIsolationThreadTimeoutInMilliseconds()
Deprecated.
As of release 1.4.0, replaced by
executionTimeoutInMilliseconds() . Timeout is no longer specific to thread-isolation commands, so the thread-specific name is misleading.
Time in milliseconds at which point the command will timeout and halt execution.
If |
HystrixProperty<java.lang.Boolean> |
executionTimeoutEnabled()
Whether the timeout mechanism is enabled for this command
|
HystrixProperty<java.lang.Integer> |
executionTimeoutInMilliseconds()
Time in milliseconds at which point the command will timeout and halt execution.
|
HystrixProperty<java.lang.Boolean> |
fallbackEnabled()
Whether
HystrixCommand.getFallback() should be attempted when failure occurs. |
HystrixProperty<java.lang.Integer> |
fallbackIsolationSemaphoreMaxConcurrentRequests()
Number of concurrent requests permitted to
HystrixCommand.getFallback() . |
HystrixProperty<java.lang.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. |
HystrixProperty<java.lang.Integer> |
metricsRollingPercentileBucketSize()
Maximum number of values stored in each bucket of the rolling percentile.
|
HystrixProperty<java.lang.Boolean> |
metricsRollingPercentileEnabled()
Whether percentile metrics should be captured using
HystrixRollingPercentile inside HystrixCommandMetrics . |
HystrixProperty<java.lang.Integer> |
metricsRollingPercentileWindow()
Deprecated.
|
HystrixProperty<java.lang.Integer> |
metricsRollingPercentileWindowBuckets()
Number of buckets the rolling percentile window is broken into.
|
HystrixProperty<java.lang.Integer> |
metricsRollingPercentileWindowInMilliseconds()
Duration of percentile rolling window in milliseconds.
|
HystrixProperty<java.lang.Integer> |
metricsRollingStatisticalWindowBuckets()
Number of buckets the rolling statistical window is broken into.
|
HystrixProperty<java.lang.Integer> |
metricsRollingStatisticalWindowInMilliseconds()
Duration of statistical rolling window in milliseconds.
|
HystrixProperty<java.lang.Boolean> |
requestCacheEnabled()
Whether
AbstractCommand.getCacheKey() should be used with HystrixRequestCache to provide de-duplication functionality via request-scoped caching. |
HystrixProperty<java.lang.Boolean> |
requestLogEnabled()
Whether
HystrixCommand execution and events should be logged to HystrixRequestLog . |
static HystrixCommandProperties.Setter |
Setter()
Factory method to retrieve the default Setter.
|
protected HystrixCommandProperties(HystrixCommandKey key)
protected HystrixCommandProperties(HystrixCommandKey key, HystrixCommandProperties.Setter builder)
protected HystrixCommandProperties(HystrixCommandKey key, HystrixCommandProperties.Setter builder, java.lang.String propertyPrefix)
public HystrixProperty<java.lang.Boolean> circuitBreakerEnabled()
HystrixCircuitBreaker
or not. If false no circuit-breaker logic will be used and all requests permitted.
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.
HystrixProperty<Boolean>
public HystrixProperty<java.lang.Integer> circuitBreakerErrorThresholdPercentage()
It will stay tripped for the duration defined in circuitBreakerSleepWindowInMilliseconds()
;
The error percentage this is compared against comes from HystrixCommandMetrics.getHealthCounts()
.
HystrixProperty<Integer>
public HystrixProperty<java.lang.Boolean> circuitBreakerForceClosed()
HystrixCircuitBreaker.allowRequest()
will always return true to allow requests regardless of the error percentage from HystrixCommandMetrics.getHealthCounts()
.
The circuitBreakerForceOpen()
property takes precedence so if it set to true this property does nothing.
HystrixProperty<Boolean>
public HystrixProperty<java.lang.Boolean> circuitBreakerForceOpen()
HystrixCircuitBreaker.allowRequest()
will always return false, causing the circuit to be open (tripped) and reject all requests.
This property takes precedence over circuitBreakerForceClosed()
;
HystrixProperty<Boolean>
public HystrixProperty<java.lang.Integer> circuitBreakerRequestVolumeThreshold()
metricsRollingStatisticalWindowInMilliseconds()
that must exist before the HystrixCircuitBreaker
will trip.
If below this number the circuit will not trip regardless of error percentage.
HystrixProperty<Integer>
public HystrixProperty<java.lang.Integer> circuitBreakerSleepWindowInMilliseconds()
HystrixCircuitBreaker
trips open that it should wait before trying requests again.HystrixProperty<Integer>
public HystrixProperty<java.lang.Integer> executionIsolationSemaphoreMaxConcurrentRequests()
HystrixCommand.run()
. Requests beyond the concurrent limit will be rejected.
Applicable only when executionIsolationStrategy()
== SEMAPHORE.
HystrixProperty<Integer>
public HystrixProperty<HystrixCommandProperties.ExecutionIsolationStrategy> executionIsolationStrategy()
HystrixCommand.run()
will be executed with.
If HystrixCommandProperties.ExecutionIsolationStrategy.THREAD
then it will be executed on a separate thread and concurrent requests limited by the number of threads in the thread-pool.
If HystrixCommandProperties.ExecutionIsolationStrategy.SEMAPHORE
then it will be executed on the calling thread and concurrent requests limited by the semaphore count.
HystrixProperty<Boolean>
public HystrixProperty<java.lang.Boolean> executionIsolationThreadInterruptOnTimeout()
Future.cancel(boolean)
) when a thread times out.
Applicable only when executionIsolationStrategy()
== THREAD.
HystrixProperty<Boolean>
public HystrixProperty<java.lang.String> executionIsolationThreadPoolKeyOverride()
HystrixThreadPoolKey
that will dynamically change which HystrixThreadPool
a HystrixCommand
executes on.
Typically this should return NULL which will cause it to use the HystrixThreadPoolKey
injected into a HystrixCommand
or derived from the HystrixCommandGroupKey
.
When set the injected or derived values will be ignored and a new HystrixThreadPool
created (if necessary) and the HystrixCommand
will begin using the newly defined pool.
HystrixProperty<String>
@Deprecated public HystrixProperty<java.lang.Integer> executionIsolationThreadTimeoutInMilliseconds()
executionTimeoutInMilliseconds()
. Timeout is no longer specific to thread-isolation commands, so the thread-specific name is misleading.
Time in milliseconds at which point the command will timeout and halt execution.
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.
HystrixProperty<Integer>
public HystrixProperty<java.lang.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.
HystrixProperty<Integer>
public HystrixProperty<java.lang.Boolean> executionTimeoutEnabled()
HystrixProperty<Boolean>
public HystrixProperty<java.lang.Integer> fallbackIsolationSemaphoreMaxConcurrentRequests()
HystrixCommand.getFallback()
. Requests beyond the concurrent limit will fail-fast and not attempt retrieving a fallback.HystrixProperty<Integer>
public HystrixProperty<java.lang.Boolean> fallbackEnabled()
HystrixCommand.getFallback()
should be attempted when failure occurs.HystrixProperty<Boolean>
public HystrixProperty<java.lang.Integer> metricsHealthSnapshotIntervalInMilliseconds()
HystrixCircuitBreaker.isOpen()
status.
On high-volume circuits the continual calculation of error percentage can become CPU intensive thus this controls how often it is calculated.
HystrixProperty<Integer>
public HystrixProperty<java.lang.Integer> metricsRollingPercentileBucketSize()
HystrixRollingPercentile
inside HystrixCommandMetrics
.HystrixProperty<Integer>
public HystrixProperty<java.lang.Boolean> metricsRollingPercentileEnabled()
HystrixRollingPercentile
inside HystrixCommandMetrics
.HystrixProperty<Boolean>
public HystrixProperty<java.lang.Integer> metricsRollingPercentileWindow()
metricsRollingPercentileWindowInMilliseconds()
HystrixRollingPercentile
inside HystrixCommandMetrics
.HystrixProperty<Integer>
public HystrixProperty<java.lang.Integer> metricsRollingPercentileWindowInMilliseconds()
HystrixRollingPercentile
inside HystrixCommandMetrics
.HystrixProperty<Integer>
public HystrixProperty<java.lang.Integer> metricsRollingPercentileWindowBuckets()
HystrixRollingPercentile
inside HystrixCommandMetrics
.HystrixProperty<Integer>
public HystrixProperty<java.lang.Integer> metricsRollingStatisticalWindowInMilliseconds()
HystrixRollingNumber
inside HystrixCommandMetrics
.HystrixProperty<Integer>
public HystrixProperty<java.lang.Integer> metricsRollingStatisticalWindowBuckets()
HystrixRollingNumber
inside HystrixCommandMetrics
.HystrixProperty<Integer>
public HystrixProperty<java.lang.Boolean> requestCacheEnabled()
AbstractCommand.getCacheKey()
should be used with HystrixRequestCache
to provide de-duplication functionality via request-scoped caching.HystrixProperty<Boolean>
public HystrixProperty<java.lang.Boolean> requestLogEnabled()
HystrixCommand
execution and events should be logged to HystrixRequestLog
.HystrixProperty<Boolean>
public static HystrixCommandProperties.Setter Setter()
public static HystrixCommandProperties.Setter defaultSetter()