spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Extend FeignCircuitBreaker builder

Open joaoqalves opened this issue 2 years ago • 3 comments

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 avatar Nov 06 '21 22:11 joaoqalves

@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.

pivotal-cla avatar Nov 06 '21 22:11 pivotal-cla

@joaoqalves Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Nov 06 '21 22:11 pivotal-cla

Codecov Report

Merging #624 (3e4bec7) into main (4e23e0c) will decrease coverage by 0.26%. The diff coverage is 50.00%.

Impacted file tree graph

@@             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:

codecov[bot] avatar Nov 23 '21 11:11 codecov[bot]