From 9ebcdebfdcb62b1704205a974e96438b6b861e43 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 19 Jul 2021 15:34:55 +0300 Subject: [PATCH] Fix integration between Rest Client Reactive and OpenTracing Fixes: #18806 --- .../deployment/RestClientReactiveProcessor.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 626a5cc8a028f..b430fb8a37541 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 @@ -58,6 +58,8 @@ import io.quarkus.deployment.builditem.ConfigurationTypeBuildItem; import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; import io.quarkus.deployment.builditem.FeatureBuildItem; +import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; import io.quarkus.deployment.util.AsmUtil; import io.quarkus.gizmo.ClassCreator; import io.quarkus.gizmo.MethodCreator; @@ -110,6 +112,20 @@ void setUpDefaultMediaType(BuildProducer con } } + @BuildStep + void registerRestClientListenerForTracing( + Capabilities capabilities, + BuildProducer resource, + BuildProducer reflectiveClass) { + if (capabilities.isPresent(Capability.SMALLRYE_OPENTRACING)) { + resource.produce(new NativeImageResourceBuildItem( + "META-INF/services/org.eclipse.microprofile.rest.client.spi.RestClientListener")); + reflectiveClass + .produce(new ReflectiveClassBuildItem(true, false, false, + "io.smallrye.opentracing.SmallRyeRestClientListener")); + } + } + @BuildStep @Record(ExecutionTime.STATIC_INIT) void setupAdditionalBeans(