spring-cloud-openfeign
spring-cloud-openfeign copied to clipboard
Extend FeignCircuitBreaker builder
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
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:
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!
Codecov Report
Merging #624 (3e4bec7) into main (4e23e0c) will decrease coverage by
0.26%
. The diff coverage is50.00%
.
@@ 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
Impacted Files | Coverage Δ | |
---|---|---|
...framework/cloud/openfeign/FeignCircuitBreaker.java | 65.71% <50.00%> (-16.64%) |
:arrow_down: |