spring-cloud / spring-cloud-openfeign

Support for using OpenFeign in Spring Cloud apps
Apache License 2.0
1.2k stars 779 forks source link

springbootspring-cloud-openfeign-core:3.1.4 Response compression Failure after HttpClient dependency is introduced #952

Closed wangliuliu1115 closed 9 months ago

wangliuliu1115 commented 10 months ago

springboot、spirngcloud、springcloudalibaba version-dependent:

<spring-boot-version>2.6.11</spring-boot-version>
<spirng-cloud-version>2021.0.4</spirng-cloud-version>
<spring-cloud-alibaba-version>2021.0.4.0</spring-cloud-alibaba-version>
<feign-httpclient-version>11.8</feign-httpclient-version>

When openfeign uses HttpClient to initiate remote calls, response compression is invalid. The response compression takes effect after the HttpClient dependency is removed May I ask if there is a solution,Thanks

wangliuliu1115 commented 10 months ago

feign-gzip-demo.zipThis is my test code. After lowering the version in the global pom.xml to the version I annotated, and after annotating the bootstrap dependency out of the submodule, GZIP compression will take effect even when the httpclient dependency response is introduced

wangliuliu1115 commented 10 months ago

One problem with this version is that because ContentLength is always -1, the threshold for the server.min-Response-size configuration does not take effect until I add a ResonseConfig configuration class to the demo. GZIP compression is enabled regardless of the number of responders

OlgaMaciaszek commented 9 months ago

Hello @wangliuliu1115, these versions of Spring Cloud and Spring Boot are out of open-source support. Please upgrade to Spring Cloud 2022.0.4 or 2023.0.0 (and Java 17) and the corresponding Boot version, and if the issue persists, please provide an upgraded sample.

spring-cloud-issues commented 9 months ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.