Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
alpha
beta
delta
gamma
master
README.md
diagram.png
pom.xml

README.md

KumuluzEE OpenTracing tutorial

This is a starting point for the tutorial, published on the KumuluzEE blog. Finished project is available on branch opentracing_tutorial_finished. It is designed purely for purposes of demonstrating OpenTracing, which is why the only thing these microservices do is communicate with each other using HTTP requests. It is also beginner friendly due to the code being really simple.

Structure

Project consists of 5 microservices:

  1. master - This is the entry point of the application. It is served on http://localhost:8080 (actual endpoint on v1/master). When queried, it makes two requests: to alpha endpoint v1/alpha and to beta endpoint v1/beta.
  2. alpha - This is the first of 4 "slave" microservices. It is served on http://localhost:8081 and has two endpoints: /v1/alpha (just returns value) and /v1/alpha/beta, which queries gamma endpoint v1/gamma.
  3. beta - This is the second of 4 "slave" microservices. It is served on http://localhost:8082 and has one endpoint: /v1/beta, which queries alpha endpoint /v1/alpha/beta. Simulated lag is added to this request (random delay).
  4. gamma - This is the third of 4 "slave" microservices. It is served on http://localhost:8083 and has one endpoint: /v1/gamma, which queries delta endpoint /v1/delta. This microservice is different, because it uses a simulated database with CDI.
  5. delta - This is the last of 4 "slave" microservices. It is served on http://localhost:8084 and has one endpoint: /v1/delta, which just return a value.

alt text

Requirements

In order to run this example you will need the following:

  1. Java 8 (or newer), you can use any implementation:

    • If you have installed Java, you can check the version by typing the following in a command line:

      java -version
      
  2. Maven 3.2.1 (or newer):

    • If you have installed Maven, you can check the version by typing the following in a command line:

      mvn -version
      
  3. Git:

    • If you have installed Git, you can check the version by typing the following in a command line:

      git --version
      

Usage

The example uses maven to build and run the microservices.

  1. Build the sample using maven:

    $ cd kumuluzee-opentracing-tutorial
    $ mvn clean package
  2. Run the sample (all five microservices):

  • Uber-jar:

    $ java -jar target/${project.build.finalName}.jar

    in Windows environemnt use the command

    java -jar target/${project.build.finalName}.jar
  • Exploded:

    $ java -cp target/classes:target/dependency/* com.kumuluz.ee.EeApplication

    in Windows environment use the command

    java -cp target/classes;target/dependency/* com.kumuluz.ee.EeApplication

The microservices can be accessed on the following URLs:

To shut down the example simply stop the processes in the foreground.

You can’t perform that action at this time.