-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend FeignCircuitBreaker builder #624
base: main
Are you sure you want to change the base?
Extend FeignCircuitBreaker builder #624
Conversation
Background ===== In December 2020, this project got support for [Spring Cloud CircuitBreaker](spring-cloud@63a5248). At the same time, [Hystrix support](spring-cloud@63a5248#diff-c296f2567f513e037087d5f9d6f44acf6752e6b066088447d99fccde837fb0cfL53-L57) was removed. Problem ===== In cases where people were creating the `HystrixFeignClient` manually using the `HystrixFeignBuilder`, and overriding properties such as `encoder(Encoder encoder)`, the new alternative does not support it. Example of the code working before: ```java HystrixFeign.builder() .encoder(jacksonEncoder) .decoder(jacksonDecoder) .target(MyClient.class, "https://api.my-url.com/", myFallback); ``` Currently, this is not supported, as the `FeignCircuitBreaker` does not override `encoder`, `decoder`, among others. Goal ====== To reestablish the previous functionality, so users can still create the Feign clients programmatically, while using custom encoders, and benefit from the circuit breaker.
@joaoqalves Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@joaoqalves Thank you for signing the Contributor License Agreement! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaoqalves thanks for submitting the PR. Please add tests and document your change (in spring-cloud-openfeign.adoc
). Also, please add your full name and surname with @author
tag to the javadocs of all the classes you've changed.
Codecov Report
@@ Coverage Diff @@
## main #624 +/- ##
============================================
- Coverage 78.87% 78.61% -0.27%
Complexity 535 535
============================================
Files 65 65
Lines 1955 1973 +18
Branches 271 271
============================================
+ Hits 1542 1551 +9
- Misses 264 273 +9
Partials 149 149
|
Background
In December 2020, this project got support for
Spring Cloud CircuitBreaker.
At the same time, Hystrix support
was removed.
Problem
In cases where people were creating the
HystrixFeignClient
manuallyusing the
HystrixFeignBuilder
, and overriding properties such asencoder(Encoder encoder)
, the new alternative does not support it.Example of the code working before:
Currently, this is not supported, as the
FeignCircuitBreaker
doesnot override
encoder
,decoder
, among others.Goal
To reestablish the previous functionality, so users can still create
the Feign clients programmatically, while using custom encoders, and
benefit from the circuit breaker.