Circuit Breaker & Backpressure

Protect your downstream infrastructure from cascade failures using automated circuit breaking and backpressure.

What is a Circuit Breaker?

If your downstream database goes down or a deployment introduces a fatal bug causing your webhook handler to return 500 Internal Server Error, continuously firing retries wastes compute resources and floods your error tracking tools.

Bunnylynk features an integrated Circuit Breaker on every Destination:

stateDiagram-v2
    [*] --> Closed
    Closed --> Open: Consecutive Failures > Threshold
    Open --> HalfOpen: Cooldown Window Expires
    HalfOpen --> Closed: Probe Request Succeeds (2xx)
    HalfOpen --> Open: Probe Request Fails

Circuit States

  1. Closed (Healthy): All webhooks are delivered in real time up to configured rate limits.
  2. Open (Tripped): When error rate exceeds 50% or consecutive failures reach threshold (default: 10), the circuit opens. Dispatches are paused and buffered safely in durable storage.
  3. Half-Open (Testing): After a cooldown window (default: 60s), Bunnylynk sends a single probe webhook. If it succeeds, the circuit closes and backlogged messages drain at a controlled pace. If it fails, the circuit re-opens.

Configuring the Circuit Breaker

{
  "circuit_breaker": {
    "enabled": true,
    "failure_threshold": 10,
    "cooldown_period_sec": 60,
    "auto_drain_rate_per_sec": 5
  }
}

Next: Review Sender Rate Limits.