@Service public class HelloService { public HelloService(... , CircuitBreakerRegistry cbr) { ... this.circuitBreaker = cbr.circuitBreaker("helloApi"); } ... Circuit Breaker name
public Hello hello() { CheckedFunction0<Hello> function = circuitBreaker.decorateCheckedSupplier( // API access () -> restTemplate.getForObject( apiUrl, Hello.class) ); // To next slide Decorating API access
reserved. 14 # HELP resilience4j_circuitbreaker_calls_seconds Total number of successful calls # TYPE resilience4j_circuitbreaker_calls_seconds summary resilience4j_circuitbreaker_calls_seconds_count{kin d="failed",name="helloApi",} 0.0 ...