#3578·feign

JDK 21 on x86_64 causes truncated responses with Feign + HttpClient (content compression related)

Author: ABin-HuangCreated Sep 21, 2026Updated Sep 21, 2026

Summary

After upgrading from JDK 17 to JDK 21, Feign client calls receive truncated response data when running on x86_64 Linux servers. The same code works correctly on Windows.

Expected Behavior

Feign should receive the complete response body regardless of the operating system or architecture.

Actual Behavior

  • On Windows (dev machine): responses are complete, no truncation.
  • On x86_64 Linux server (JDK 21): response data is truncated — the tail of the response body is missing.

Workaround

Calling httpClientBuilder.disableContentCompression() when building the HttpClient fixes the truncation issue on x86_64 servers. This suggests the problem is related to gzip / content-encoding decompression in combination with JDK 21 on x86_64.

Environment

  • Feign version: (please fill in)
  • bisheng JDK version: 21.0.11 (upgraded from 17)
  • OS: Linux x86_64 (server) — affected
  • OS: Windows (dev machine) — not affected
  • HTTP client: (please fill in, e.g. Apache HttpClient / hc5)

Steps to Reproduce

  1. Set up a Feign client with JDK 21 on an x86_64 Linux server.
  2. Call an endpoint that returns a gzip-compressed response.
  3. Observe that the received response body is truncated.
  4. Add .disableContentCompression() to the HttpClient builder.
  5. Response is now complete.

Additional Context

The disableContentCompression workaround strongly indicates a JDK 21 regression in gzip/deflate decompression handling on x86_64 architecture, possibly interacting with the Feign HttpClient