The Circuit Breaker and Retry patterns both handle service call failures but take opposite approaches: Retry keeps trying the same request, while Circuit Breaker stops sending requests once a service is clearly failing.
If a Payment Service has a five-second outage, Retry alone might succeed on the second attempt for one request, but under sustained load a Circuit Breaker is what actually protects the system by tripping open after enough failures and stopping the flood of retried requests until the service recovers.
resilience4j:
# Retry: try the SAME call again, for short, temporary failures
retry:
instances:
payment:
max-attempts: 3
wait-duration: 200ms
enable-exponential-backoff: true
retry-exceptions:
- java.net.SocketTimeoutException
# Circuit breaker: STOP calling for a while when failures keep happening
circuitbreaker:
instances:
payment:
failure-rate-threshold: 50
wait-duration-in-open-state: 30s
// Used together: retries happen inside the circuit breaker's view,
// and once it is OPEN, calls fail fast without being retried
@Retry(name = "payment")
@CircuitBreaker(name = "payment", fallbackMethod = "later")
public Receipt pay(Order order) { return paymentClient.pay(order); }A concise interview answer is
Retry re-attempts a failed call, assuming the problem is temporary, while Circuit Breaker stops sending calls altogether once failures cross a threshold, assuming the service is genuinely unhealthy. In practice they're complementary — I wrap retries inside a circuit breaker so isolated blips get retried, but a real outage doesn't turn into a flood of repeated retry attempts.
Last updated: 1 November 2026
Previous question: Can you explain the different states of a Circuit Breaker (closed, open, half-open)?
Next question: In what situations would you use a Circuit Breaker in a microservices architecture?