Retries and circuit breakers are potentially useful in any synchronous communication between two software components, for example, microservices. Resilience4j can be used by all our microservices except for the edge server since Spring Cloud Gateway currently only supports the older circuit breaker, Netflix Hystrix. In this chapter, we will apply a circuit breaker and a retry mechanism in one place, in calls to the product service from the product-composite service. This is illustrated in the following diagram:
Note that the synchronous calls to the discovery and config servers from the other microservices are not shown in the preceding diagram (to make it easier to read).
Work is ongoing as this chapter was written to add an abstraction layer for circuit breakers in Spring Cloud, something ...