Circuit Breaker Operator for Spring Reactor
Since introduction of Spring Reactive appeared a need of a circuit breaker that would follow the reactive principles and is very light.
FailSafe provides very light circuit breaker which works perfectly with Callable and Runnable and is complicated when comes to an application on an observable sequence.
This project brings new spring reactor circuit breaker operator based on FailSafe which aims to be easy to use.
Usage
gradle
compile 'com.github.venth.failsafe:reactor:x.y.z'
maven
<dependency>
<groupId>com.github.venth.failsafe</groupId>
<artifactId>reactor</artifactId>
<version>x.y.z</version>
</dependency>
Usage for each of the ReactiveX observables type is pretty similar. The examples presented below shall explain the usage.
- xxxSequence - a sequence that depends on the operator's type.
- circuitBreaker is configured instance of FailSafe CircuitBreaker.
Flux
fluxSequence.transform(CircuitBreakerOperator.of(circuitBreaker))
Mono
monoSequence.transform(CircuitBreakerOperator.of(circuitBreaker))