when Call Provider Client by Feign, successfully have Hear "Accept-Encoding: gzip" and "Content-Encoding: gzip" in request but body dont compressed in request and resoponse

It is my customer client

server:
  port: 8082
  compression:
    enabled: true

spring:
  application:
    name: order-server
  cloud:
    openfeign:
      compression:
        request:
          enabled: true
          min-request-size: 1
          mime-types: text/xml,application/xml,application/json
        response:
          enabled: true
      client:
        config:
          default:
            connectTimeout: 3000
            readTimeout: 5000

Sample It is my demo project git link You can call this link http://localhost:8082/order/updateUserByBody and look req and rsp log key "END HTTP (2733-byte body)"

Comment From: LLLLxr

Post http://localhost:8082/order/updateUserByBody { "id": "1", "name": "Blake", "phone": "13333333333", "address": "珠海" } you can make body byte length > 2048 for test

Comment From: OlgaMaciaszek

Hello @LLLLxr, thanks for creating the issue. Please check the doc for the correct properties to set to enable the compression mechanism to OF (you seem to be using different ones).

Once you've fixed that, enabling this actually does is add appropriate compression headers and the compression itself should be handled by the underlying client. You can read more about this in https://github.com/spring-cloud/spring-cloud-openfeign/issues/639#issuecomment-988862953 and https://github.com/spring-cloud/spring-cloud-openfeign/issues/635. I have also created an issue to add more documentation on that behaviour.