diff --git a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java index 0af9df3ca2dcb..558dbfe0468b3 100644 --- a/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/rest-client-reactive/deployment/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java @@ -52,6 +52,7 @@ import org.jboss.jandex.MethodInfo; import org.jboss.jandex.Type; import org.jboss.logging.Logger; +import org.jboss.resteasy.reactive.client.interceptors.ClientGZIPDecodingInterceptor; import org.jboss.resteasy.reactive.client.spi.MissingMessageBodyReaderErrorMessageContextualizer; import org.jboss.resteasy.reactive.common.processor.ResteasyReactiveDotNames; import org.jboss.resteasy.reactive.common.processor.transformation.AnnotationStore; @@ -108,6 +109,7 @@ class RestClientReactiveProcessor { private static final DotName KOTLIN_METADATA_ANNOTATION = DotName.createSimple("kotlin.Metadata"); private static final String DISABLE_SMART_PRODUCES_QUARKUS = "quarkus.rest-client.disable-smart-produces"; + private static final String ENABLE_COMPRESSION = "quarkus.http.enable-compression"; private static final String KOTLIN_INTERFACE_DEFAULT_IMPL_SUFFIX = "$DefaultImpls"; private static final Set SKIP_COPYING_ANNOTATIONS_TO_GENERATED_CLASS = Set.of( @@ -352,6 +354,19 @@ AdditionalBeanBuildItem registerProviderBeans(CombinedIndexBuildItem combinedInd return builder.build(); } + @BuildStep + void registerCompressionInterceptors(BuildProducer reflectiveClasses) { + Boolean enableCompression = ConfigProvider.getConfig() + .getOptionalValue(ENABLE_COMPRESSION, Boolean.class) + .orElse(false); + if (enableCompression) { + reflectiveClasses.produce(ReflectiveClassBuildItem + .builder(ClientGZIPDecodingInterceptor.class) + .serialization(false) + .build()); + } + } + @BuildStep @Record(ExecutionTime.STATIC_INIT) void addRestClientBeans(Capabilities capabilities,