Circuit Breaker Configuration Tool

Design and simulate circuit breaker state transitions

Configuration

% failures to open circuit
Min calls before decision
Wait before half-open
Permitted during half-open
Latency to count as slow
Slow calls to trigger open

Presets

Simulate Requests

Circuit Breaker State

CLOSED
Accepting requests
Failure Rate
0%
Total Calls
0
Blocked Calls
0
MTBF
-s
Failure Rate Threshold: 50%
0%

Call History (last 50)

Event Log

Availability Metrics

Availability
100%
0 downtime periods

Implementation Code

Resilience4j (Java)
CircuitBreakerConfig config = CircuitBreakerConfig.custom() .failureRateThreshold(50) .slowCallRateThreshold(50) .slowCallDurationThreshold(Duration.ofMillis(1000)) .waitDurationInOpenState(Duration.ofSeconds(30)) .minimumNumberOfCalls(10) .permittedNumberOfCallsInHalfOpenState(3) .build(); CircuitBreaker breaker = CircuitBreaker.of("myBreaker", config); breaker.executeSupplier(() -> callDownstream());
Polly (.NET)
var policy = Policy.Handle() .OrResult(r => !r.IsSuccessStatusCode) .CircuitBreaker(5, TimeSpan.FromSeconds(30), onBreak: (outcome, ts) => Console.WriteLine("Circuit opened"), onReset: () => Console.WriteLine("Circuit closed")); var response = await policy.ExecuteAsync(() => httpClient.GetAsync("https://api.example.com"));
opossum (Node.js)
const breaker = new CircuitBreaker(callFunction, { timeout: 1000, errorThresholdPercentage: 50, resetTimeout: 30000, rollingCountTimeout: 10000, rollingCountBuckets: 10, name: 'myService' }); await breaker.fire(args).catch(err => { if (err.breaker) console.log('Circuit open'); });
Hystrix Pattern (Overview)
public class MyService { @HystrixCommand( fallbackMethod = "fallback", commandProperties = { @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "1000"), @HystrixProperty(name = "circuitBreaker.errorThresholdPercentage", value = "50"), @HystrixProperty(name = "circuitBreaker.sleepWindowInMilliseconds", value = "30000") } ) public String callDownstream() { return restTemplate.getForObject("...", String.class); } public String fallback() { return "Service unavailable"; } }

Recommended by our team

BeLikeNative.com

The #1 AI writing tool for freelancers — perfect grammar in any language, instantly.