Skip to content

Enhance MVC CircuitBreaker: add support for 'not permitted' handling and resume-without-error behavior - #4000

Merged
ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
raccoonback:mvc-circuitbreaker-enhancements
Dec 2, 2025
Merged

Enhance MVC CircuitBreaker: add support for 'not permitted' handling and resume-without-error behavior#4000
ryanjbaxter merged 1 commit into
spring-cloud:mainfrom
raccoonback:mvc-circuitbreaker-enhancements

Conversation

@raccoonback

Copy link
Copy Markdown
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

raccoonback commented Nov 27, 2025

Copy link
Copy Markdown
Contributor Author

@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 <kosb15@naver.com>
@raccoonback
raccoonback force-pushed the mvc-circuitbreaker-enhancements branch from 8c6e4da to 8254758 Compare November 27, 2025 15:29
@ryanjbaxter ryanjbaxter added this to the 5.0.1 milestone Dec 2, 2025
@github-project-automation github-project-automation Bot moved this to Todo in 2025.1.1 Dec 2, 2025
@ryanjbaxter
ryanjbaxter merged commit e9a7079 into spring-cloud:main Dec 2, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in 2025.1.1 Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants