Yet Another TEch bLog: Reactive Jersey Client using Java 8, RxJava and Netflix Hystrix
Jersey
Jersey supports RxJava Observable, Java 8 CompletionStage and CompletableFuture, Guava ListenableFuture and Futures, JSR-166e CompletableFuture. It also provides SPI to be extended by custom reactive libraries.There is excellent 3 part blog post series written by Michal Gajdoš about Reactive Jersey Client:
- Reactive Jersey Client – Motivation
- Reactive Jersey Client – Usage and Supported Reactive Libraries
- Reactive Jersey Client – Customization (SPI)
Jersey source code contains also examples for supported reactive libraries, see modules:
- examples/rx-client-webapp - Jersey Reactive Client Extension WebApp Example.
- examples/rx-client-java8-webapp - Jersey Reactive Client Extension (Java8) WebApp Example.
Hystrix
Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
You usually use Hystrix to isolate dependent system call into HystrixCommand class. It allows to be executed synchronously, asynchronously (returns java.util.concurrent.Future) and also asynchronously via RxJava Observable.
Read full article from Yet Another TEch bLog: Reactive Jersey Client using Java 8, RxJava and Netflix Hystrix
No comments:
Post a Comment