Search in sources :

Example 6 with CircuitBreakerRegistry

use of io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry in project resilience4j by resilience4j.

the class CircuitBreakerExportsTest method testConstructors.

@Test
public void testConstructors() {
    final CircuitBreakerRegistry registry = new InMemoryCircuitBreakerRegistry();
    CircuitBreakerExports.ofIterable("boo_breakers", singleton(CircuitBreaker.ofDefaults("foo")));
    CircuitBreakerExports.ofCircuitBreakerRegistry("boo_breakers", registry);
    CircuitBreakerExports.ofSupplier("boo_breakers", () -> singleton(CircuitBreaker.ofDefaults("foo")));
    CircuitBreakerExports.ofIterable(singleton(CircuitBreaker.ofDefaults("foo")));
    CircuitBreakerExports.ofCircuitBreakerRegistry(registry);
    CircuitBreakerExports.ofSupplier(() -> singleton(CircuitBreaker.ofDefaults("foo")));
}
Also used : InMemoryCircuitBreakerRegistry(io.github.resilience4j.circuitbreaker.internal.InMemoryCircuitBreakerRegistry) InMemoryCircuitBreakerRegistry(io.github.resilience4j.circuitbreaker.internal.InMemoryCircuitBreakerRegistry) CircuitBreakerRegistry(io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry) Test(org.junit.Test)

Aggregations

CircuitBreakerRegistry (io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry)6 Test (org.junit.Test)4 CircuitBreaker (io.github.resilience4j.circuitbreaker.CircuitBreaker)3 CircuitBreakerConfig (io.github.resilience4j.circuitbreaker.CircuitBreakerConfig)2 InMemoryCircuitBreakerRegistry (io.github.resilience4j.circuitbreaker.internal.InMemoryCircuitBreakerRegistry)2 CircuitBreakerHealthIndicator (io.github.resilience4j.circuitbreaker.monitoring.health.CircuitBreakerHealthIndicator)1 Meter (io.micrometer.core.instrument.Meter)1 Bean (org.springframework.context.annotation.Bean)1