From 6b813a340484ae94df5184f32b4d6de6b821b7fc Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Mon, 20 Nov 2023 10:30:34 +0100 Subject: [PATCH 1/2] Update mvn-settings.xml to use USA based mirror --- .github/mvn-settings.xml | 44 +++++++++++++++------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/.github/mvn-settings.xml b/.github/mvn-settings.xml index e8cadeb8..908d426b 100644 --- a/.github/mvn-settings.xml +++ b/.github/mvn-settings.xml @@ -1,30 +1,17 @@ - + - google-mirror-jboss-proxy + google-mirror google-maven-central - GCS Maven Central mirror EU - https://maven-central-eu.storage-download.googleapis.com/repos/central/data/ - - false - - - - jboss-maven-central-proxy - JBoss Maven Central proxy - https://repository.jboss.org/nexus/content/repositories/central/ - - false - - - - gradle-official-repository - Gradle Official Repository - https://repo.gradle.org/gradle/libs-releases-local/ + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + false @@ -33,18 +20,19 @@ google-maven-central - GCS Maven Central mirror EU - https://maven-central-eu.storage-download.googleapis.com/repos/central/data/ - - - jboss-maven-central-proxy - JBoss Maven Central proxy - https://repository.jboss.org/nexus/content/repositories/central/ + GCS Maven Central mirror + https://maven-central.storage-download.googleapis.com/maven2/ + + true + + + false + - google-mirror-jboss-proxy + google-mirror From 8d5ac46a8bc35fdf76b50bcbd92935764500623a Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Mon, 20 Nov 2023 13:44:00 +0100 Subject: [PATCH 2/2] OpenTracing moved out of Quarkus core repository --- 002-quarkus-all-extensions/pom.xml | 4 - .../README.md | 4 - 010-quarkus-opentracing-reactive-grpc/pom.xml | 82 ------------------- .../io/quarkus/qe/ping/GrpcPingResource.java | 28 ------- .../java/io/quarkus/qe/ping/PingResource.java | 28 ------- .../quarkus/qe/ping/ReactivePingResource.java | 30 ------- .../qe/ping/ServerSentEventsPingResource.java | 28 ------- .../quarkus/qe/ping/clients/PongClient.java | 17 ---- .../qe/ping/clients/ReactivePongClient.java | 19 ----- .../clients/ServerSentEventsPongClient.java | 19 ----- .../io/quarkus/qe/pong/GrpcPongService.java | 26 ------ .../java/io/quarkus/qe/pong/PongResource.java | 19 ----- .../quarkus/qe/pong/ReactivePongResource.java | 20 ----- .../qe/pong/ServerSentEventsPongResource.java | 20 ----- .../qe/traceable/TraceableResource.java | 28 ------- .../src/main/proto/pong.proto | 18 ---- .../src/main/resources/application.properties | 21 ----- .../qe/AbstractPingPongResourceTest.java | 69 ---------------- .../quarkus/qe/GrpcPingPongResourceTest.java | 30 ------- ...ReactivePingPongResourceOpentracingIT.java | 7 -- ...tiveRestPingPongResourceOpentracingIT.java | 7 -- ...ntEventsPingPongResourceOpentracingIT.java | 11 --- ...activePingPongResourceOpentracingTest.java | 12 --- .../RestPingPongResourceOpentracingTest.java | 12 --- ...EventsPingPongResourceOpentracingTest.java | 15 ---- .../containers/JaegerApiEndpointAddress.java | 8 -- .../qe/containers/JaegerTestResource.java | 72 ---------------- 101-javaee-like-getting-started/README.md | 2 +- 101-javaee-like-getting-started/pom.xml | 4 - pom.xml | 1 - 30 files changed, 1 insertion(+), 660 deletions(-) delete mode 100644 010-quarkus-opentracing-reactive-grpc/README.md delete mode 100644 010-quarkus-opentracing-reactive-grpc/pom.xml delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/GrpcPingResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/PingResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ReactivePingResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ServerSentEventsPingResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/PongClient.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ReactivePongClient.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ServerSentEventsPongClient.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/GrpcPongService.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/PongResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ReactivePongResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ServerSentEventsPongResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/traceable/TraceableResource.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/proto/pong.proto delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/main/resources/application.properties delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/AbstractPingPongResourceTest.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeReactivePingPongResourceOpentracingIT.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeRestPingPongResourceOpentracingIT.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeServerSentEventsPingPongResourceOpentracingIT.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ReactivePingPongResourceOpentracingTest.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/RestPingPongResourceOpentracingTest.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ServerSentEventsPingPongResourceOpentracingTest.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerApiEndpointAddress.java delete mode 100644 010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerTestResource.java diff --git a/002-quarkus-all-extensions/pom.xml b/002-quarkus-all-extensions/pom.xml index 3aaf9b28..acd17d0a 100644 --- a/002-quarkus-all-extensions/pom.xml +++ b/002-quarkus-all-extensions/pom.xml @@ -152,10 +152,6 @@ io.quarkus quarkus-spring-di - - io.quarkus - quarkus-smallrye-opentracing - io.quarkus quarkus-smallrye-reactive-messaging-amqp diff --git a/010-quarkus-opentracing-reactive-grpc/README.md b/010-quarkus-opentracing-reactive-grpc/README.md deleted file mode 100644 index 82f7bb73..00000000 --- a/010-quarkus-opentracing-reactive-grpc/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Module that test whether the opentracing data is transmitted among REST resources using Rest Client. -There are two applications: -- Ping application that will invoke the Pong application using the RestClient and will return the expected "ping pong" output. -- Pong application that will return the "pong" output. \ No newline at end of file diff --git a/010-quarkus-opentracing-reactive-grpc/pom.xml b/010-quarkus-opentracing-reactive-grpc/pom.xml deleted file mode 100644 index 52155474..00000000 --- a/010-quarkus-opentracing-reactive-grpc/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - 4.0.0 - - io.quarkus.qe - beefy-scenarios - 1.0.0-SNAPSHOT - - 010-quarkus-opentracing-reactive-grpc - - - io.quarkus - quarkus-resteasy-mutiny - - - io.quarkus - quarkus-smallrye-opentracing - - - io.quarkus - quarkus-rest-client - - - io.quarkus - quarkus-grpc - - - org.testcontainers - testcontainers - test - - - org.awaitility - awaitility - test - - - - - - io.quarkus - quarkus-maven-plugin - - - - generate-code - generate-code-tests - build - - - - - - - - - - skip-tests-on-windows - - - windows - - - - - - maven-surefire-plugin - - true - - - - maven-failsafe-plugin - - true - - - - - - - diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/GrpcPingResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/GrpcPingResource.java deleted file mode 100644 index fadb45b4..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/GrpcPingResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.quarkus.qe.ping; - -import io.quarkus.example.PongRequest; -import io.quarkus.example.PongServiceGrpc; -import io.quarkus.grpc.GrpcClient; -import io.quarkus.qe.traceable.TraceableResource; - -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/grpc-ping") -public class GrpcPingResource extends TraceableResource { - - @Inject - @GrpcClient("pong") - PongServiceGrpc.PongServiceBlockingStub pongClient; - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String getPing() { - recordTraceId(); - - return "ping " + pongClient.sayPong(PongRequest.newBuilder().build()).getMessage(); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/PingResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/PingResource.java deleted file mode 100644 index a67d11f8..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/PingResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.quarkus.qe.ping; - -import org.eclipse.microprofile.rest.client.inject.RestClient; - -import io.quarkus.qe.ping.clients.PongClient; -import io.quarkus.qe.traceable.TraceableResource; - -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/rest-ping") -public class PingResource extends TraceableResource { - - @Inject - @RestClient - PongClient pongClient; - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String getPing() { - recordTraceId(); - - return "ping " + pongClient.getPong(); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ReactivePingResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ReactivePingResource.java deleted file mode 100644 index 94b2effd..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ReactivePingResource.java +++ /dev/null @@ -1,30 +0,0 @@ -package io.quarkus.qe.ping; - -import org.eclipse.microprofile.rest.client.inject.RestClient; - -import io.quarkus.qe.ping.clients.ReactivePongClient; -import io.quarkus.qe.traceable.TraceableResource; -import io.smallrye.mutiny.Uni; - -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/reactive-ping") -public class ReactivePingResource extends TraceableResource { - - @Inject - @RestClient - ReactivePongClient pongClient; - - @GET - @Produces(MediaType.TEXT_PLAIN) - public Uni getPing() { - recordTraceId(); - return pongClient.getPong().onItem().transform(response -> { - return "ping " + response; - }); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ServerSentEventsPingResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ServerSentEventsPingResource.java deleted file mode 100644 index f420e846..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/ServerSentEventsPingResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.quarkus.qe.ping; - -import org.eclipse.microprofile.rest.client.inject.RestClient; - -import io.quarkus.qe.ping.clients.ServerSentEventsPongClient; -import io.quarkus.qe.traceable.TraceableResource; -import io.smallrye.mutiny.Multi; - -import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/server-sent-events-ping") -public class ServerSentEventsPingResource extends TraceableResource { - - @Inject - @RestClient - ServerSentEventsPongClient pongClient; - - @GET - @Produces(MediaType.SERVER_SENT_EVENTS) - public Multi getPing() { - recordTraceId(); - return Multi.createFrom().publisher(pongClient.getPong()).map(response -> "ping " + response); - } -} \ No newline at end of file diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/PongClient.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/PongClient.java deleted file mode 100644 index b7e14d93..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/PongClient.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.quarkus.qe.ping.clients; - -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@RegisterRestClient -public interface PongClient { - @GET - @Path("/rest-pong") - @Produces(MediaType.TEXT_PLAIN) - String getPong(); - -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ReactivePongClient.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ReactivePongClient.java deleted file mode 100644 index 98d0d96a..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ReactivePongClient.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.quarkus.qe.ping.clients; - -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; - -import io.smallrye.mutiny.Uni; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@RegisterRestClient -public interface ReactivePongClient { - @GET - @Path("/reactive-pong") - @Produces(MediaType.TEXT_PLAIN) - Uni getPong(); - -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ServerSentEventsPongClient.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ServerSentEventsPongClient.java deleted file mode 100644 index 475c4fe9..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/ping/clients/ServerSentEventsPongClient.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.quarkus.qe.ping.clients; - -import java.util.concurrent.Flow.Publisher; - -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@RegisterRestClient -public interface ServerSentEventsPongClient { - @GET - @Path("/server-sent-events-pong") - @Produces(MediaType.SERVER_SENT_EVENTS) - Publisher getPong(); - -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/GrpcPongService.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/GrpcPongService.java deleted file mode 100644 index 3c696559..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/GrpcPongService.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.quarkus.qe.pong; - -import org.jboss.logmanager.MDC; - -import io.grpc.stub.StreamObserver; -import io.quarkus.example.PongReply; -import io.quarkus.example.PongRequest; -import io.quarkus.example.PongServiceGrpc; -import io.quarkus.grpc.GrpcService; - -@GrpcService -public class GrpcPongService extends PongServiceGrpc.PongServiceImplBase { - - private String lastTraceId; - - @Override - public void sayPong(PongRequest request, StreamObserver responseObserver) { - lastTraceId = MDC.get("traceId"); - responseObserver.onNext(PongReply.newBuilder().setMessage("pong").build()); - responseObserver.onCompleted(); - } - - public String getLastTraceId() { - return lastTraceId; - } -} \ No newline at end of file diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/PongResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/PongResource.java deleted file mode 100644 index 22349d78..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/PongResource.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.quarkus.qe.pong; - -import io.quarkus.qe.traceable.TraceableResource; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/rest-pong") -public class PongResource extends TraceableResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public String getPong() { - recordTraceId(); - return "pong"; - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ReactivePongResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ReactivePongResource.java deleted file mode 100644 index 70a59e3e..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ReactivePongResource.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.quarkus.qe.pong; - -import io.quarkus.qe.traceable.TraceableResource; -import io.smallrye.mutiny.Uni; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/reactive-pong") -public class ReactivePongResource extends TraceableResource { - - @GET - @Produces(MediaType.TEXT_PLAIN) - public Uni getPong() { - recordTraceId(); - return Uni.createFrom().item("pong"); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ServerSentEventsPongResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ServerSentEventsPongResource.java deleted file mode 100644 index bfad3971..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/pong/ServerSentEventsPongResource.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.quarkus.qe.pong; - -import io.quarkus.qe.traceable.TraceableResource; -import io.smallrye.mutiny.Multi; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -@Path("/server-sent-events-pong") -public class ServerSentEventsPongResource extends TraceableResource { - - @GET - @Produces(MediaType.SERVER_SENT_EVENTS) - public Multi getPong() { - recordTraceId(); - return Multi.createFrom().item("pong"); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/traceable/TraceableResource.java b/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/traceable/TraceableResource.java deleted file mode 100644 index 60ed0eb0..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/java/io/quarkus/qe/traceable/TraceableResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.quarkus.qe.traceable; - -import org.jboss.logging.Logger; -import org.jboss.logmanager.MDC; - -import jakarta.ws.rs.GET; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; - -public abstract class TraceableResource { - - private static final Logger LOG = Logger.getLogger(TraceableResource.class); - - private String lastTraceId; - - @GET - @Path("/lastTraceId") - @Produces(MediaType.TEXT_PLAIN) - public String getLastTraceId() { - return lastTraceId; - } - - protected void recordTraceId() { - lastTraceId = MDC.get("traceId"); - LOG.info("Recorded trace ID: " + lastTraceId); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/proto/pong.proto b/010-quarkus-opentracing-reactive-grpc/src/main/proto/pong.proto deleted file mode 100644 index bb09f1d2..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/proto/pong.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "io.quarkus.example"; -option java_outer_classname = "PongProto"; - -package io.quarkus.example; - -service PongService { - rpc SayPong (PongRequest) returns (PongReply) {} -} - -message PongRequest { -} - -message PongReply { - string message = 1; -} \ No newline at end of file diff --git a/010-quarkus-opentracing-reactive-grpc/src/main/resources/application.properties b/010-quarkus-opentracing-reactive-grpc/src/main/resources/application.properties deleted file mode 100644 index 09b6b159..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/main/resources/application.properties +++ /dev/null @@ -1,21 +0,0 @@ -# Quarkus -quarkus.http.port=8081 - -# Jaeger -quarkus.jaeger.service-name=pingpong -quarkus.jaeger.sampler-type=const -quarkus.jaeger.sampler-param=1 -quarkus.log.console.format=%d{HH:mm:ss} %-5p traceId=%X{traceId}, parentId=%X{parentId}, spanId=%X{spanId}, sampled=%X{sampled} [%c{2.}] (%t) %s%e%n - -# RestClient -io.quarkus.qe.ping.clients.PongClient/mp-rest/url=http://localhost:8081 -io.quarkus.qe.ping.clients.PongClient/mp-rest/scope=javax.inject.Singleton - -io.quarkus.qe.ping.clients.ReactivePongClient/mp-rest/url=http://localhost:8081 -io.quarkus.qe.ping.clients.ReactivePongClient/mp-rest/scope=javax.inject.Singleton - -io.quarkus.qe.ping.clients.ServerSentEventsPongClient/mp-rest/url=http://localhost:8081 -io.quarkus.qe.ping.clients.ServerSentEventsPongClient/mp-rest/scope=javax.inject.Singleton - -# gRPC -quarkus.grpc.clients.pong.host=localhost \ No newline at end of file diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/AbstractPingPongResourceTest.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/AbstractPingPongResourceTest.java deleted file mode 100644 index 68be8fbc..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/AbstractPingPongResourceTest.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.quarkus.qe; - -import static io.restassured.RestAssured.given; -import static org.awaitility.Awaitility.await; -import static org.hamcrest.Matchers.allOf; -import static org.hamcrest.Matchers.containsString; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import java.util.concurrent.TimeUnit; - -import org.apache.http.HttpStatus; -import org.junit.jupiter.api.Test; - -import io.quarkus.qe.containers.JaegerApiEndpointAddress; -import io.quarkus.qe.containers.JaegerTestResource; -import io.quarkus.test.common.QuarkusTestResource; - -@QuarkusTestResource(JaegerTestResource.class) -public abstract class AbstractPingPongResourceTest { - - private static final String PING_ENDPOINT = "/%s-ping"; - private static final String PONG_ENDPOINT = "/%s-pong"; - - private static final String PING_RESOURCE = "PingResource"; - private static final String PONG_RESOURCE = "PongResource"; - - @JaegerApiEndpointAddress - String jaegerEndpoint; - - @Test - public void testPingPong() { - // When calling ping, the rest will invoke also the pong rest endpoint. - given() - .when().get(pingEndpoint()) - .then().statusCode(HttpStatus.SC_OK) - .body(containsString("ping pong")); - - // Then both ping and pong rest endpoints should have the same trace Id. - String pingTraceId = given() - .when().get(pingEndpoint() + "/lastTraceId") - .then().statusCode(HttpStatus.SC_OK).and().extract().asString(); - - assertTraceIdWithPongService(pingTraceId); - - // Then Jaeger is invoked - await().atMost(5, TimeUnit.SECONDS).untilAsserted(() -> given() - .when().get(jaegerEndpoint + "/" + pingTraceId) - .then().statusCode(HttpStatus.SC_OK) - .and().body(allOf(containsString(PING_RESOURCE), containsString(PONG_RESOURCE)))); - } - - protected abstract String endpointPrefix(); - - protected void assertTraceIdWithPongService(String expected) { - String pongTraceId = given() - .when().get(pongEndpoint() + "/lastTraceId") - .then().statusCode(HttpStatus.SC_OK).and().extract().asString(); - - assertEquals(expected, pongTraceId); - } - - private String pingEndpoint() { - return String.format(PING_ENDPOINT, endpointPrefix()); - } - - private String pongEndpoint() { - return String.format(PONG_ENDPOINT, endpointPrefix()); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java deleted file mode 100644 index 10952967..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/GrpcPingPongResourceTest.java +++ /dev/null @@ -1,30 +0,0 @@ -package io.quarkus.qe; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Disabled; - -import io.quarkus.grpc.GrpcService; -import io.quarkus.qe.pong.GrpcPongService; -import io.quarkus.test.junit.QuarkusTest; - -import jakarta.inject.Inject; - -@Disabled("Caused by https://github.com/quarkusio/quarkus/issues/13224") -@QuarkusTest -public class GrpcPingPongResourceTest extends AbstractPingPongResourceTest { - - @Inject - @GrpcService - GrpcPongService pongService; - - @Override - protected String endpointPrefix() { - return "grpc"; - } - - @Override - protected void assertTraceIdWithPongService(String expected) { - assertEquals(expected, pongService.getLastTraceId()); - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeReactivePingPongResourceOpentracingIT.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeReactivePingPongResourceOpentracingIT.java deleted file mode 100644 index 23722fa5..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeReactivePingPongResourceOpentracingIT.java +++ /dev/null @@ -1,7 +0,0 @@ -package io.quarkus.qe; - -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@QuarkusIntegrationTest -public class NativeReactivePingPongResourceOpentracingIT extends ReactivePingPongResourceOpentracingTest { -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeRestPingPongResourceOpentracingIT.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeRestPingPongResourceOpentracingIT.java deleted file mode 100644 index 2ea98daf..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeRestPingPongResourceOpentracingIT.java +++ /dev/null @@ -1,7 +0,0 @@ -package io.quarkus.qe; - -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@QuarkusIntegrationTest -public class NativeRestPingPongResourceOpentracingIT extends RestPingPongResourceOpentracingTest { -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeServerSentEventsPingPongResourceOpentracingIT.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeServerSentEventsPingPongResourceOpentracingIT.java deleted file mode 100644 index 6bd7f197..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/NativeServerSentEventsPingPongResourceOpentracingIT.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.quarkus.qe; - -import org.junit.jupiter.api.Disabled; - -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@QuarkusIntegrationTest -@Disabled("https://github.com/quarkusio/quarkus/issues/30935") -public class NativeServerSentEventsPingPongResourceOpentracingIT extends ServerSentEventsPingPongResourceOpentracingTest { - -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ReactivePingPongResourceOpentracingTest.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ReactivePingPongResourceOpentracingTest.java deleted file mode 100644 index ffd8503c..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ReactivePingPongResourceOpentracingTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.quarkus.qe; - -import io.quarkus.test.junit.QuarkusTest; - -@QuarkusTest -public class ReactivePingPongResourceOpentracingTest extends AbstractPingPongResourceTest { - - @Override - protected String endpointPrefix() { - return "reactive"; - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/RestPingPongResourceOpentracingTest.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/RestPingPongResourceOpentracingTest.java deleted file mode 100644 index 9bdefea0..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/RestPingPongResourceOpentracingTest.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.quarkus.qe; - -import io.quarkus.test.junit.QuarkusTest; - -@QuarkusTest -public class RestPingPongResourceOpentracingTest extends AbstractPingPongResourceTest { - - @Override - protected String endpointPrefix() { - return "rest"; - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ServerSentEventsPingPongResourceOpentracingTest.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ServerSentEventsPingPongResourceOpentracingTest.java deleted file mode 100644 index cb60a2d1..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/ServerSentEventsPingPongResourceOpentracingTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.quarkus.qe; - -import org.junit.jupiter.api.Disabled; - -import io.quarkus.test.junit.QuarkusTest; - -@QuarkusTest -@Disabled("https://github.com/quarkusio/quarkus/issues/30935") -public class ServerSentEventsPingPongResourceOpentracingTest extends AbstractPingPongResourceTest { - - @Override - protected String endpointPrefix() { - return "server-sent-events"; - } -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerApiEndpointAddress.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerApiEndpointAddress.java deleted file mode 100644 index 82bed13a..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerApiEndpointAddress.java +++ /dev/null @@ -1,8 +0,0 @@ -package io.quarkus.qe.containers; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -@Retention(RetentionPolicy.RUNTIME) -public @interface JaegerApiEndpointAddress { -} diff --git a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerTestResource.java b/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerTestResource.java deleted file mode 100644 index b984bab1..00000000 --- a/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerTestResource.java +++ /dev/null @@ -1,72 +0,0 @@ -package io.quarkus.qe.containers; - -import java.lang.reflect.Field; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; - -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; - -public class JaegerTestResource implements QuarkusTestResourceLifecycleManager { - - public static final String JAEGER_API_ENDPOINT = "jaeger.api.endpoint"; - - private static final String JAEGER_ENDPOINT = "http://%s:%s/api/traces"; - private static final int TRACE_PORT = 14268; - private static final int REST_PORT = 16686; - private static final String QUARKUS_JAEGER_PROPERTY = "quarkus.jaeger.endpoint"; - - private GenericContainer container; - - @Override - public Map start() { - - container = new GenericContainer<>("jaegertracing/all-in-one:latest") - .waitingFor( - new LogMessageWaitStrategy().withRegEx(".*\"Health Check state change\",\"status\":\"ready\".*\\s")) - .withExposedPorts(TRACE_PORT, REST_PORT); - container.start(); - - return Collections.singletonMap(QUARKUS_JAEGER_PROPERTY, traceEndpoint()); - } - - @Override - public void stop() { - Optional.ofNullable(container).ifPresent(GenericContainer::stop); - } - - @Override - public void inject(Object testInstance) { - Class c = testInstance.getClass(); - while (c != Object.class) { - for (Field f : c.getDeclaredFields()) { - JaegerApiEndpointAddress jaegerEndpoint = f.getAnnotation(JaegerApiEndpointAddress.class); - if (jaegerEndpoint != null) { - setFieldValue(f, testInstance, apiEndpoint()); - } - } - c = c.getSuperclass(); - } - } - - private String traceEndpoint() { - return String.format(JAEGER_ENDPOINT, container.getContainerIpAddress(), container.getMappedPort(TRACE_PORT)); - } - - private String apiEndpoint() { - return String.format(JAEGER_ENDPOINT, container.getContainerIpAddress(), container.getMappedPort(REST_PORT)); - } - - private void setFieldValue(Field f, Object testInstance, Object value) { - try { - f.setAccessible(true); - f.set(testInstance, value); - return; - } catch (Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/101-javaee-like-getting-started/README.md b/101-javaee-like-getting-started/README.md index 9a87a78c..7706380b 100644 --- a/101-javaee-like-getting-started/README.md +++ b/101-javaee-like-getting-started/README.md @@ -1,6 +1,6 @@ # scenario-101-getting-started -Based on `mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create -DprojectGroupId=io.quarkus.qe -DprojectArtifactId=scenario-101-getting-started -DprojectVersion=1.0.0-SNAPSHOT -DclassName="io.quarkus.qe.hello.GreetingResource" -Dextensions=io.quarkus:quarkus-hibernate-orm,io.quarkus:quarkus-jsonb,io.quarkus:quarkus-jsonp,io.quarkus:quarkus-resteasy-jsonb,io.quarkus:quarkus-narayana-jta,io.quarkus:quarkus-elytron-security,io.quarkus:quarkus-scheduler,io.quarkus:quarkus-swagger-ui,io.quarkus:quarkus-hibernate-validator,io.quarkus:quarkus-undertow-websockets,io.quarkus:quarkus-smallrye-fault-tolerance,io.quarkus:quarkus-smallrye-metrics,io.quarkus:quarkus-smallrye-openapi,io.quarkus:quarkus-smallrye-jwt,io.quarkus:quarkus-smallrye-health,io.quarkus:quarkus-smallrye-opentracing` generated project +Based on `mvn io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:create -DprojectGroupId=io.quarkus.qe -DprojectArtifactId=scenario-101-getting-started -DprojectVersion=1.0.0-SNAPSHOT -DclassName="io.quarkus.qe.hello.GreetingResource" -Dextensions=io.quarkus:quarkus-hibernate-orm,io.quarkus:quarkus-jsonb,io.quarkus:quarkus-jsonp,io.quarkus:quarkus-resteasy-jsonb,io.quarkus:quarkus-narayana-jta,io.quarkus:quarkus-elytron-security,io.quarkus:quarkus-scheduler,io.quarkus:quarkus-swagger-ui,io.quarkus:quarkus-hibernate-validator,io.quarkus:quarkus-undertow-websockets,io.quarkus:quarkus-smallrye-fault-tolerance,io.quarkus:quarkus-smallrye-metrics,io.quarkus:quarkus-smallrye-openapi,io.quarkus:quarkus-smallrye-jwt,io.quarkus:quarkus-smallrye-health` generated project Uses MP health (https://quarkus.io/guides/microprofile-health) and MP metrics (https://quarkus.io/guides/microprofile-metrics). diff --git a/101-javaee-like-getting-started/pom.xml b/101-javaee-like-getting-started/pom.xml index 93fa2c45..cdfc1cc8 100644 --- a/101-javaee-like-getting-started/pom.xml +++ b/101-javaee-like-getting-started/pom.xml @@ -63,10 +63,6 @@ io.quarkus quarkus-jsonp - - io.quarkus - quarkus-smallrye-opentracing - io.quarkus quarkus-narayana-jta diff --git a/pom.xml b/pom.xml index dd746735..271db451 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,6 @@ 004-quarkus-HHH-and-HV 005-quarkus-and-maven-profiles 006-quartz-manually-scheduled-job - 010-quarkus-opentracing-reactive-grpc 011-quarkus-panache-rest-flyway 013-quarkus-oidc-restclient 014-quarkus-panache-with-transactions-xa