How it works...

In this recipe we have done three things after adding the Hystrix dependency library to our project. So, let's take a look at each step in detail to learn what exactly happens:

  • The @EnableCircuitBreaker annotation, similar to @EnableDiscoveryClient, or @EnableFeignClients, which explicitly indicates that we want Spring Cloud to load appropriate configurations from spring.factories from all the libraries which have the org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker key defined.
  • In the case of Hystrix, it will load HystrixCircuitBreakerConfiguration, which provides the necessary configuration to enable the Hystrix functionality within the application. One of the beans it creates, is the HystrixCommandAspect ...

Get Developing Java Applications with Spring and Spring Boot now with O’Reilly online learning.

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