Skip to content

Commit

Permalink
Ensure that SSE builder works in native
Browse files Browse the repository at this point in the history
Fixes: #36402
  • Loading branch information
geoand committed Oct 11, 2023
1 parent 798dba7 commit 0b1a09b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -122,8 +124,11 @@ void setupProviders(BuildProducer<NativeImageResourceBuildItem> resources,
}

@BuildStep
void setupClientBuilder(BuildProducer<NativeImageResourceBuildItem> resources) {
void setupClientBuilder(BuildProducer<NativeImageResourceBuildItem> resources,
BuildProducer<ServiceProviderBuildItem> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -226,6 +228,8 @@ void registerClientResponseBuilder(BuildProducer<ServiceProviderBuildItem> servi
serviceProviders.produce(new ServiceProviderBuildItem(ClientBuilder.class.getName(),
ClientBuilderImpl.class.getName()));

serviceProviders.produce(new ServiceProviderBuildItem(SseEventSource.Builder.class.getName(),
SseEventSourceBuilderImpl.class.getName()));
}

@BuildStep
Expand Down

0 comments on commit 0b1a09b

Please sign in to comment.