In the linked tutorial, you’ll build a microservice application that uses the Circuit Breaker pattern to gracefully degrade functionality when a method call fails.
Example:
public Mono<String> readingList() {
return readingListCircuitBreaker.run(webClient.get().uri("/recommended").retrieve().bodyToMono(String.class), throwable -> {
LOG.warn("Error making request to book service", throwable);
return Mono.just("Cloud Native Java (O'Reilly)");
});
}
Links
https://spring.io/guides/gs/cloud-circuit-breaker/