Skip to content

Gepardec/sample-microprofile-opentracing

Repository files navigation

Sample application MicroProfile-Opentracing

This repository holds the sample application for illustrating the usage of MicroProfile-Opentracing with Thorntail, Quarkus and Wildfly, and is part of an article you find at https://www.gepardec.com/blog/ among other interesting articles.

Description

This sample application implements a simple JEE application which uses MicroProfile-Opentracing to trace its rest resources as well as rest clients and runs as a microservice with Thorntail, Quarkus and as a WAR deployment in Wildfly.

Resources

How to build

Thorntail microservice
mvn clean install -Pthorntail
Quarkus microservice
mvn clean install -Pquarkus
Wildfly WAR deployment
mvn clean install -Pwildfly

How to run

Start Thorntail microservice
mvn thorntail:run -Pthorntail
Start Quarkus microservice
java "-Djava.net.preferIPv4Stack=true" -jar target\microprofile-opentracing-0.0.1-SNAPSHOT-runner.jar
Tip
Normally the maven goal quarkus:dev should start the application as well but it fails with ClassNotFoundException (org/jboss/logging/Logger).
I’m not familiar with Qurakus yet, so we run the jar instead.
Start/Configure/Deploy Wildfly
mvn wildfly:run -Pwildfly

Prepare test

This sample application requires a Jaeger instance running on localhost:6831 where the traces are sent.

Start Jaeger with docker
docker run -p 6831:6831/udp -p 16686:16686 --name jaeger-local jaegertracing/all-in-one:latest

How to test

If you use Intellij then you can use the test.http file for testing the rest endpoints.
Otherwise see the following available endpoints and use the tool of your choice.

With injectable rest client

GET call to external resource

GET http://127.0.0.1:8080/get

POST call to external resource

POST http://127.0.0.1:8080/post

PATCH call to external resource

PATCH http://127.0.0.1:8080/patch

DELETE call to external resource

DELETE http://127.0.0.1:8080/delete

With custom built rest client

GET call to external resource

GET http://127.0.0.1:8080/custom/get

POST call to external resource

POST http://127.0.0.1:8080/custom/post

PATCH call to external resource

PATCH http://127.0.0.1:8080/custom/patch

DELETE call to external resource

DELETE http://127.0.0.1:8080/custom/delete

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages