public static final class HystrixCommand.Setter
extends java.lang.Object
HystrixCommand
constructor.
The required arguments are set via the 'with' factory method and optional arguments via the 'and' chained methods.
Example:
Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("GroupName"))
.andCommandKey(HystrixCommandKey.Factory.asKey("CommandName"));
Modifier and Type | Field and Description |
---|---|
protected HystrixCommandKey |
commandKey |
protected HystrixCommandProperties.Setter |
commandPropertiesDefaults |
protected HystrixCommandGroupKey |
groupKey |
protected HystrixThreadPoolKey |
threadPoolKey |
protected HystrixThreadPoolProperties.Setter |
threadPoolPropertiesDefaults |
Modifier | Constructor and Description |
---|---|
protected |
Setter(HystrixCommandGroupKey groupKey)
Setter factory method containing required values.
|
Modifier and Type | Method and Description |
---|---|
HystrixCommand.Setter |
andCommandKey(HystrixCommandKey commandKey) |
HystrixCommand.Setter |
andCommandPropertiesDefaults(HystrixCommandProperties.Setter commandPropertiesDefaults)
Optional
|
HystrixCommand.Setter |
andThreadPoolKey(HystrixThreadPoolKey threadPoolKey) |
HystrixCommand.Setter |
andThreadPoolPropertiesDefaults(HystrixThreadPoolProperties.Setter threadPoolPropertiesDefaults)
Optional
|
static HystrixCommand.Setter |
withGroupKey(HystrixCommandGroupKey groupKey)
Setter factory method with required values.
|
protected HystrixCommandKey commandKey
protected HystrixCommandProperties.Setter commandPropertiesDefaults
protected final HystrixCommandGroupKey groupKey
protected HystrixThreadPoolKey threadPoolKey
protected HystrixThreadPoolProperties.Setter threadPoolPropertiesDefaults
protected Setter(HystrixCommandGroupKey groupKey)
All optional arguments can be set via the chained methods.
groupKey
- HystrixCommandGroupKey
used to group together multiple HystrixCommand
objects.
The HystrixCommandGroupKey
is used to represent a common relationship between commands. For example, a library or team name, the system all related commands interace
with,
common business purpose etc.
public static HystrixCommand.Setter withGroupKey(HystrixCommandGroupKey groupKey)
All optional arguments can be set via the chained methods.
groupKey
- HystrixCommandGroupKey
used to group together multiple HystrixCommand
objects.
The HystrixCommandGroupKey
is used to represent a common relationship between commands. For example, a library or team name, the system all related commands interace
with,
common business purpose etc.
public HystrixCommand.Setter andCommandKey(HystrixCommandKey commandKey)
commandKey
- HystrixCommandKey
used to identify a HystrixCommand
instance for statistics, circuit-breaker, properties, etc.
By default this will be derived from the instance class name.
NOTE: Every unique HystrixCommandKey
will result in new instances of HystrixCircuitBreaker
, HystrixCommandMetrics
and HystrixCommandProperties
.
Thus,
the number of variants should be kept to a finite and reasonable number to avoid high-memory usage or memory leacks.
Hundreds of keys is fine, tens of thousands is probably not.
public HystrixCommand.Setter andThreadPoolKey(HystrixThreadPoolKey threadPoolKey)
threadPoolKey
- HystrixThreadPoolKey
used to define which thread-pool this command should run in (when configured to run on separate threads via
HystrixCommandProperties.executionIsolationStrategy()
).
By default this is derived from the HystrixCommandGroupKey
but if injected this allows multiple commands to have the same HystrixCommandGroupKey
but different
thread-pools.
public HystrixCommand.Setter andCommandPropertiesDefaults(HystrixCommandProperties.Setter commandPropertiesDefaults)
commandPropertiesDefaults
- HystrixCommandProperties.Setter
with property overrides for this specific instance of HystrixCommand
.
See the HystrixPropertiesStrategy
JavaDocs for more information on properties and order of precedence.
public HystrixCommand.Setter andThreadPoolPropertiesDefaults(HystrixThreadPoolProperties.Setter threadPoolPropertiesDefaults)
threadPoolPropertiesDefaults
- HystrixThreadPoolProperties.Setter
with property overrides for the HystrixThreadPool
used by this specific instance of HystrixCommand
.
See the HystrixPropertiesStrategy
JavaDocs for more information on properties and order of precedence.