Welcome

Let’s start from the beginning. Quarkus. What’s Quarkus? That’s a pretty good question and probably a good start. If you go to the Quarkus web site, you’ll read that Quarkus is "A Kubernetes Native Java stack tailored for OpenJDK HotSpot & GraalVM, crafted from the best of breed Java libraries and standards." This description is somewhat unclear but does an outstanding job at using bankable keywords. It’s also written: "Supersonic Subatomic Java." This is a way of saying that Quarkus is really fast, and it’s really light. But what does Quarkus do?

In practice, Quarkus is a stack to develop distributed systems and modern applications in Java, Kotlin, or Scala. Quarkus applications are tailored for the Cloud, containers, and Kubernetes. That does not mean you can’t use Quarkus in other environments, there are no limits, but the principles infused in Quarkus have made containerization of applications more efficient. In this workshop, we will explain what Quarkus is and because the best way to understand Quarkus is to use it, build a set of microservices with it. Again, Quarkus is not limited to microservices, but it’s a generally well-understood type of architecture.

This workshop offers attendees an intro-level, hands-on session with Quarkus, from the first line of code to making services, to consuming them, and finally to assembling everything in a consistent system. But, what are we going to build? Well, it’s going to be a set of microservices:

  • Using Quarkus

  • Using HTTP and events (with Apache Kafka)

  • With some parts of the dark side of microservices (resilience, health, monitoring with Prometheus)

  • Answer the ultimate question: are super-heroes stronger than super-villains?

This workshop is a BYOL (Bring Your Own Laptop) session, so bring your Windows, OSX, or Linux laptop. You need JDK 17 on your machine, Apache Maven (3.8.x), and Docker. On Mac and Windows, Docker for x is recommended instead of the Docker toolbox setup.

What you are going to learn:

  • What is Quarkus, and how you can use it

  • How to build an HTTP endpoint (REST API) with Quarkus

  • How to access a relational database

  • How you can use Swagger and OpenAPI

  • How you test your microservice

  • How to build a reactive microservice, including reactive data access

  • How you improve the resilience of your service

  • How to build event-driven microservices with Kafka

  • How to build native executable

  • How to extend Quarkus with extensions

  • And much more!

Ready? Here we go! Check the workshop at https://quarkus.io/quarkus-workshops/super-heroes/index.html of flash the QR Code if you don’t want to type.

qrcode

Presenting the Workshop

What Is This Workshop About?

This workshop should give you a practical introduction to Quarkus. You will practice all the needed tools to develop an entire microservice architecture, mixing classical HTTP, reactive and event-based microservices. You will finish by extending the capabilities of Quarkus and learn more about the ability to create native executables.

The idea is that you leave this workshop with a good understanding of what Quarkus is, what it is not, and how it can help you in your projects. Then, you’ll be prepared to investigate a bit more and, hopefully, contribute.

What Will You Be Developing?

In this workshop, you will develop an application that allows superheroes to fight against supervillains. You will be developing several microservices communicating either synchronously via REST or asynchronously using Kafka:

  • Super Hero UI: an Angular application to pick up a random superhero, a random supervillain, and makes them fight. The Super Hero UI is exposed via Quarkus and invokes the Fight REST API

  • Villain REST API: A classical HTTP microservice exposing CRUD operations on Villains, stored in a PostgreSQL database

  • Hero REST API: A reactive HTTP microservice exposing CRUD operations on Heroes, stored in a Postgres database

  • Fight REST API: This REST API invokes the Hero and Villain APIs to get a random superhero and supervillain. Each fight is, then, stored in a PostgreSQL database. This microservice can be developed using both the classical (imperative) or reactive approach. Invocations to the hero and villain services are protected using resilience patterns (retry, timeout, circuit-breakers)

  • Statistics: Each fight is asynchronously sent (via Kafka) to the Statistics microservice. It has an HTML + JQuery UI displaying all the statistics.

  • Prometheus polls metrics from the three microservices Fight, Hero, and Villain.

Diagram

The main UI allows you to pick up one random Hero and Villain by clicking on "New Fighters." Then it’s just a matter of clicking on "Fight!" to get them to fight. The table at the bottom shows the list of the previous fights.