...
Configuration
Global properties
Property | value | Description |
---|---|---|
ohf.circuitbreaker.enabled | true/false | Switch to enable entire circuit component, if set to false, nor component itself, not any CircuitBreaker implementations are initalized. Default value: false |
ohf.circuitbreaker.impl | org.openhubframework.openhub.core.circuitbreaker.CircuitBreakerInMemoryImpl org.openhubframework.openhub.core.circuitbreaker.CircuitBreakerHazelcastImpl | Implementation of org.openhubframework.openhub.spi.circuitbreaker.CircuitBreaker interface to use. Only one can be active in given time for all the circuits. See chapter Provided implementations below for details. |
For each circuit following properties are expected to be configured, as they are defined in org.openhubframework.openhub.spi.circuitbreaker.CircuitConfiguration:
Circuit configuration
Property | type | mandatory | Description |
---|---|---|---|
enabled | boolean | N | Enable or disable given circuit. Default value: true |
thresholdPercentage | int | Y | Percentage of failed requests in given window that must be exceeded in order to switch the circuit to disconnected (open) state. Value: 0-100 |
windowSizeInMillis | long | Y | Sliding window size used for evaluation. Requests out of window, are deleted. Value: millisecond count |
minimalCountInWindow | int | Y | Minimal message count in window, to consider that window relevant. This minimal number of messages in each windows is always sent. Value: count of messages |
sleepInMillis | long | Y | Sleep time, when circuit breaker is triggered. Target uri will not be passed to for this period of time. After this period, new evaluation window starts. Value: millisecond count |
Provided implementations
Out-of-box, in OHF, there are two implementations of the CircuitBreaker interface, that can be enabled just by configuration:
...