How Hystrix works

The working of Hystrix is as follows:

  1. Creating an instance of command: We need to create an instance of either HystrixCommand or HystrixObservableCommand to present the request that we are making to the dependency. These instances will be working as a wrapper around the dependency that we are requesting.
    • The instance of HystrixCommand is used to wrap a request that will execute the functionality or service over the network with fault and latency tolerance with a blocking call. However, the observe() method returns a non-blocking Observable. We prefer the instance whenever a single response is expected from the dependency. The following lines of code demonstrate the creation of an instance of HystrixCommand:
 HystrixCommand ...

Get Reactive Programming With Java 9 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.