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

GH-475: Optional Feign clients eager initialization mechanism

Open Periecle opened this issue 4 years ago • 4 comments
trafficstars

Pull Request majorly influenced by similar Ribbon feature, therefore API and configuration are close to each other for usability. Also updated documentation explaining configuration and implementation details. Fixes #475

Periecle avatar Mar 14 '21 15:03 Periecle

Codecov Report

Merging #512 (cc04f56) into master (61aee7c) will increase coverage by 0.16%. The diff coverage is 94.44%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #512      +/-   ##
============================================
+ Coverage     77.85%   78.01%   +0.16%     
- Complexity      489      496       +7     
============================================
  Files            60       62       +2     
  Lines          1820     1838      +18     
  Branches        267      267              
============================================
+ Hits           1417     1434      +17     
- Misses          256      257       +1     
  Partials        147      147              
Impacted Files Coverage Δ Complexity Δ
...work/cloud/openfeign/FeignEagerLoadProperties.java 88.88% <88.88%> (ø) 4.00 <4.00> (?)
.../openfeign/FeignApplicationContextInitializer.java 100.00% <100.00%> (ø) 2.00 <2.00> (?)
...mework/cloud/openfeign/FeignAutoConfiguration.java 82.81% <100.00%> (+0.55%) 4.00 <0.00> (ø)
.../springframework/cloud/openfeign/FeignContext.java 100.00% <100.00%> (ø) 4.00 <1.00> (+1.00)

codecov[bot] avatar Mar 14 '21 15:03 codecov[bot]

@Periecle thanks for submitting this. Have added some comments to address, however, have also run some tests on the sample provided in the issue (#475) and this does not really seem to solve the issue, so probably will require further investigation.

@OlgaMaciaszek , author of original issue was struggling with initialising feign clients in async way from ForkJoinPool, and you proposed an alternative - implement something similar to ribbon.eager-load mechanism. I think my PR won't fix sample from original issue, but propose options to provide such functionality directly without need for such workarounds with supplying fake request to FJP or any other thread pool. UPD: On second thought, it seems that cloud-openfeign need option for initialising Ribbon LB on ApplicationReadyEvent optionally on feign.ribbon.warmup, . Actually, I am already working on this feature.

Periecle avatar Mar 16 '21 12:03 Periecle

@OlgaMaciaszek, hi. Can you update me with current status of review?

Periecle avatar Mar 28 '21 12:03 Periecle

hi. Can you update me with current status of review?

@Periecle , I understood you were still working on this bit for the PR:

On second thought, it seems that cloud-openfeign need option for initialising Ribbon LB on ApplicationReadyEvent optionally on feign.ribbon.warmup, . Actually, I am already working on this feature.

Or will you be submitting it in another PR?

OlgaMaciaszek avatar Apr 12 '21 10:04 OlgaMaciaszek