-
Notifications
You must be signed in to change notification settings - Fork 10
Version 2 Configuration Keys
IMPORTANT This is documentation for versions 2.x and earlier. For the newest version see: Configuration
The configuration must be initialized on application start. See Installing and Configuring.
See also Timeouts and Cancellation.
-
Per-Command Timeout - Timeouts are configurable per-command. See Command Names to understand how the
command-namecomponent is generated from the Command's group and class name.command.<command-name>.Timeout=2000Example: A Command class called
FileExistsInS3Commandwith the command groups3would use the configuration:command.s3.FileExistsInS3.Timeout=2000 -
Global Ignore - Timeouts can be globally ignored. Only recommended for use in local/testing environments.
mjolnir.ignoreTimeouts=false
See also Bulkheads.
-
Bulkhead Maximum - The number of Commands that can execute in the Bulkhead concurrently before subsequent Command attempts are rejected.
Per-bulkhead configuration.
bulkhead-keyis the argument passed to the Command constructor.mjolnir.bulkhead.<bulkhead-key>.maxConcurrent=10System-wide default. Used if a per-bulkhead
maxConcurrentisn't configured.mjolnir.bulkhead.default.maxConcurrent=10
See also Circuit Breakers.
-
Global Enable/Disable - Circuit Breakers can be globally disabled.
mjolnir.useCircuitBreakers=true -
Counting Window - A Breakers monitors error counts within a short, non-rolling window of time, resetting counts when the window ends.
Per-breaker configuration.
breaker-keyis the argument passed to the Command constructor.mjolnir.metrics.<breaker-key>.windowMillis=30000System-wide default. Used if a per-breaker
windowMillisisn't configured.mjolnir.metrics.default.windowMillis=30000 -
Minimum Operations - a Breaker won't trip until it sees at least this many operations come through in the configured
windowMillis.Per-breaker configuration.
breaker-keyis the argument passed to the Command constructor.mjolnir.breaker.<breaker-key>.minimumOperations=10System-wide default. Used if a per-breaker
minimumOperationsisn't configured.mjolnir.breaker.default.minimumOperations=10 -
Threshold Percentage - If the error rate within the window meets or exceeds this percentage, the Breaker will trip.
Per-breaker configuration.
breaker-keyis the argument passed to the Command constructor.mjolnir.breaker.<breaker-key>.thresholdPercentage=50System-wide default. Used if a per-breaker
thresholdPercentageisn't configured.mjolnir.breaker.default.thresholdPercentage=50 -
Tripped Duration - When the Breaker trips, it will wait this long before attempting a test operation to see if it should close and fix itself.
Per-breaker configuration.
breaker-keyis the argument passed to the Command constructor.mjolnir.breaker.<breaker-key>.trippedDurationMillis=10000System-wide default. Used if a per-breaker
trippedDurationMillisisn't configured.mjolnir.breaker.default.trippedDurationMillis=10000 -
Force Tripped/Fixed - Forces a Breaker tripped (open) or fixed (closed), regardless of its current error count. If both are
true, the Breaker will be tripped.Per-breaker configurations.
breaker-keyis the argument passed to the Command constructor.mjolnir.breaker.<breaker-key>.forceTripped=false mjolnir.breaker.<breaker-key>.forceFixed=falseSystem-wide default. Used if a per-breaker
forceTripped/forceFixedisn't configured.mjolnir.breaker.default.forceTripped=false mjolnir.breaker.default.forceFixed=false
-
Global Killswitch - Mjolnir can be turned off entirely if needed (though it's certainly not recommended). If
isEnabledis set tofalse, Mjolnir will still do some initial work (like ensuring a single invoke per Command), but will then just execute the Command (callingExecute()orExecuteAsync()) instead of passing it through Bulkheads and Circuit Breakers. No timeouts will be applied; aCancellationToken.Nonewill be passed to any method that supports cancellation.mjolnir.isEnabled=true -
Gauge Metric Intervals - If using an
IMetricEventsimplementation, these are the intervals that gauges are fired for their respective components.mjolnir.bulkheadConfigGaugeIntervalMillis=60000 mjolnir.breakerConfigGaugeIntervalMillis=60000