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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.