-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
According to the gRPC specification:
For every message a server is requested to compress using an algorithm it knows the client doesn't support (as indicated by the last grpc-accept-encoding header received from the client), it SHALL send the message uncompressed.
Source: https://github.com/grpc/grpc/blob/master/doc/compression.md
Quarkus gRPC server does not respect the grpc-accept-encoding header sent by clients and instead relies solely on the quarkus.grpc.server.compression configuration setting when quarkus.grpc.server.use-separate-server=false.
Expected behavior
- When quarkus.grpc.server.compression is empty → server responds with uncompressed messages
- When quarkus.grpc.server.compression is set (e.g., "gzip") → server MUST read the client's grpc-accept-encoding header and:
- Compress the response ONLY if the client supports the compression algorithm (e.g., client sends grpc-accept-encoding: gzip)
- Send uncompressed response if client sends grpc-accept-encoding: identity
- Send uncompressed response if client doesn't list the server's compression algorithm
Actual behavior
Quarkus compresses or doesn't compress responses based solely on the quarkus.grpc.server.compression value, ignoring the grpc-accept-encoding header from the client.
How to Reproduce?
Added quick tests to illustrate the bug
Added two test cases for separate server and same http server:
https://github.com/gigi/quarkus-grpc-encoding-bug/blob/main/src/test/java/org/acme/
Output of uname -a or ver
Darwin 192.168.1.134 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64
Output of java -version
openjdk version "21.0.7" 2025-04-15 LTS OpenJDK Runtime Environment Temurin-21.0.7+6 (build 21.0.7+6-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.7+6 (build 21.0.7+6-LTS, mixed mode, sharing)
Quarkus version or git rev
3.29.0
Build tool (ie. output of mvnw --version or gradlew --version)
------------------------------------------------------------ Gradle 8.9 ------------------------------------------------------------ Build time: 2024-07-11 14:37:41 UTC Revision: d536ef36a19186ccc596d8817123e5445f30fef8 Kotlin: 1.9.23 Groovy: 3.0.21 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 Launcher JVM: 21.0.7 (Eclipse Adoptium 21.0.7+6-LTS) Daemon JVM: /Users/gigi/.sdkman/candidates/java/21.0.7-tem (no JDK specified, using current Java home) OS: Mac OS X 15.6.1 aarch64
Additional information
No response