From 0b1a09b3d7ea53fbf29148025bceb5e69315df6e Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 11 Oct 2023 16:33:32 +0300 Subject: [PATCH] Ensure that SSE builder works in native Fixes: #36402 --- .../quarkus/restclient/deployment/RestClientProcessor.java | 7 ++++++- .../reactive/deployment/JaxrsClientReactiveProcessor.java | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java b/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java index 500ac96e2c5c1..2cac5fa7164d7 100644 --- a/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java +++ b/extensions/resteasy-classic/rest-client/deployment/src/main/java/io/quarkus/restclient/deployment/RestClientProcessor.java @@ -19,6 +19,7 @@ import jakarta.ws.rs.client.ClientRequestFilter; import jakarta.ws.rs.client.ClientResponseFilter; import jakarta.ws.rs.ext.Providers; +import jakarta.ws.rs.sse.SseEventSource; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; @@ -48,6 +49,7 @@ import org.jboss.resteasy.microprofile.client.RestClientProxy; import org.jboss.resteasy.microprofile.client.async.AsyncInterceptorRxInvokerProvider; import org.jboss.resteasy.microprofile.client.publisher.MpPublisherMessageBodyReader; +import org.jboss.resteasy.plugins.providers.sse.client.SseEventSourceImpl; import org.jboss.resteasy.spi.ResteasyConfiguration; import io.quarkus.arc.BeanDestroyer; @@ -122,8 +124,11 @@ void setupProviders(BuildProducer resources, } @BuildStep - void setupClientBuilder(BuildProducer resources) { + void setupClientBuilder(BuildProducer resources, + BuildProducer serviceProviders) { resources.produce(new NativeImageResourceBuildItem("META-INF/services/jakarta.ws.rs.client.ClientBuilder")); + serviceProviders.produce(new ServiceProviderBuildItem(SseEventSource.Builder.class.getName(), + SseEventSourceImpl.SourceBuilder.class.getName())); } @BuildStep diff --git a/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java b/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java index 4cecf9feab2e9..bd86f0b3c6a22 100644 --- a/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java +++ b/extensions/resteasy-reactive/jaxrs-client-reactive/deployment/src/main/java/io/quarkus/jaxrs/client/reactive/deployment/JaxrsClientReactiveProcessor.java @@ -65,6 +65,7 @@ import jakarta.ws.rs.core.UriBuilder; import jakarta.ws.rs.ext.ParamConverter; import jakarta.ws.rs.ext.ParamConverterProvider; +import jakarta.ws.rs.sse.SseEventSource; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; @@ -86,6 +87,7 @@ import org.jboss.resteasy.reactive.client.impl.ClientBuilderImpl; import org.jboss.resteasy.reactive.client.impl.ClientImpl; import org.jboss.resteasy.reactive.client.impl.MultiInvoker; +import org.jboss.resteasy.reactive.client.impl.SseEventSourceBuilderImpl; import org.jboss.resteasy.reactive.client.impl.StorkClientRequestFilter; import org.jboss.resteasy.reactive.client.impl.UniInvoker; import org.jboss.resteasy.reactive.client.impl.WebTargetImpl; @@ -226,6 +228,8 @@ void registerClientResponseBuilder(BuildProducer servi serviceProviders.produce(new ServiceProviderBuildItem(ClientBuilder.class.getName(), ClientBuilderImpl.class.getName())); + serviceProviders.produce(new ServiceProviderBuildItem(SseEventSource.Builder.class.getName(), + SseEventSourceBuilderImpl.class.getName())); } @BuildStep