Introducing the Resilience4j circuit breaker and retry mechanism

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

Get Hands-On Microservices with Spring Boot and Spring Cloud 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.