Allow optional wrapping in NoFallbackAvailableException in CircuitBreaker
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với lớp CircuitBreaker trong spring-cloud-commons/src/main/java/org/springframework/cloud/client/circuitbreaker/CircuitBreaker.java và xem xét cách phương thức run mặc định bọc các ngoại lệ. Xác định cách một thuộc tính cấu hình tùy chọn sẽ kiểm soát hành vi đó, đảm bảo rằng khi việc bọc bị vô hiệu hóa thì ngoại lệ gốc được giữ nguyên, còn khi được bật thì hành vi của NoFallbackAvailableException vẫn được duy trì.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
I'm building an application with Spring Cloud 2023 using Feign and Resilience4j.
In the CircuitBreaker class, methods that do not have a fallback by default have any exceptions thrown wrapped in a NoFallbackAvailableException:
default <T> T run(Supplier<T> toRun) {
return run(toRun, throwable -> {
throw new NoFallbackAvailableException("No fallback available.", throwable);
});
}
This is not behaviour that we see with the vanilla implementation of Resilience4j, which just throws the exception as it is, without wrapping it.
I noticed this behaviour because I want to ignore an exception across all circuit breakers, and so set the following property resilience4j.circuitbreaker.configs.default.ignore-exceptions=.... With the automatic wrapping, however, higher-level code should be expecting a NoFallbackAvailableException instead of the exception that's actually been marked as ignored. Additionally, higher-level circuit breakers will not be able to continue ignoring this exception. [1]
Describe the solution you'd like
Would it be possible to make wrapping the exception in a NoFallbackAvailableException optional, controlled by some kind of property?
Describe alternatives you've considered
We can of course catch the NoFallbackAvailableException, get the root cause and then throw that exception.
[1] I know that multiple stacked circuit breakers aren't ideal, however I would like all Feign calls to be protected by circuit breakers, which can be done with the following property spring.cloud.openfeign.circuitbreaker.enabled=true. The downside of using this property is that you have no control over the fallbacks for those automatic circuit breakers. In this particular case, I am unable to add a fallback to the feign client itself, as it is shared among different services. Because of this, I would like to add a manual circuit breaker around the code using @CircuitBreaker(name = "getX", fallbackMethod = "getFallbackX").
- Ngôn ngữ chính
- Java
- Star
- 751
- Fork
- 767
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của spring-cloud/spring-cloud-commons
-
waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
spring-cloud/spring-cloud-commons#1708 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
waiting-for-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
spring-cloud/spring-cloud-commons#1543 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement for team discussion
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
spring-cloud/spring-cloud-commons#1676 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
waiting-for-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
spring-cloud/spring-cloud-commons#1675 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
waiting-for-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
spring-cloud/spring-cloud-commons#1640 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của spring-cloud/spring-cloud-commons
Issue tương tự
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
-
bug subsystem:agent-harness triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ShaftHQ/SHAFT_ENGINE#7797 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ARM: Q flag should be stickyĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
NationalSecurityAgency/ghidra#10155 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:data coverage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 67/100
reacher-z/Awesome-CUA#4864 ·
Maintainer thường phản hồi trong vòng 19 ngày
-
bug web-ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
jenkinsci/jenkins#27705 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày