Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that SSE builder works in native #36408

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading