Skip to content

Conversation

@raccoonback
Copy link
Contributor

Motivation

The existing MVC implementation did not handle CallNotPermittedException and lacked a way to "resume without error," which is frequently needed in real-world production systems where graceful degradation is desired.

Summary

This PR enhances the MVC CircuitBreakerFilterFunctions by adding missing error-handling cases and introducing a new configuration option (resumeWithoutError).
The goal is to align the MVC implementation more closely with the WebFlux CircuitBreaker behavior and improve overall resilience and configurability.

Key Changes

  1. Support for CallNotPermittedException
  • When the circuit breaker is open (Resilience4J CallNotPermittedException), the filter now returns:
    503 Service Unavailable
  • This aligns MVC behavior with the WebFlux CircuitBreaker implementation.
  1. Add resumeWithoutError option
  • New configuration flag: resumeWithoutError
  • When enabled:
    • Normal/unhandled exceptions return 200 OK instead of propagating an error.
    • Timeout exceptions still return 504 Gateway Timeout
    • Call-not-permitted exceptions still return 503 Service Unavailable

@raccoonback
Copy link
Contributor Author

raccoonback commented Nov 27, 2025

@ryanjbaxter @spencergibb
Hello.
I'd appreciate it if you could review this PR.

…ror cases

- Return 503 Service Unavailable when CircuitBreaker is open or not permitted
- Return 200 OK when resume-without-error is configured

Signed-off-by: raccoonback <[email protected]>
@raccoonback raccoonback force-pushed the mvc-circuitbreaker-enhancements branch from 8c6e4da to 8254758 Compare November 27, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants