O'Reilly logo

Reactive Programming With Java 9 by Tejaswini Mandar Jog

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required