2 Your first Quarkus application

 

This chapter covers

  • Creating a Quarkus project
  • Developing with Quarkus live coding
  • Writing tests for a Quarkus microservice
  • Deploying and running a microservice to Kubernetes

Throughout the book we will use the domain of banking to create microservice examples, highlighting key concepts from each chapter. The example will be an Account service. The purpose of the Account service is to manage bank accounts, holding information like customer name, balance, and overdraft status. In developing the Account service, the chapter will cover the ways to create Quarkus projects, developing with live coding for real-time feedback, writing tests, building native executables for an application, how to package an application for Kubernetes, and how to deploy to Kubernetes.

There’s a lot to cover; let’s dive into creating the Account service!

2.1 Creating a project

We can create a microservice using Quarkus in the following ways:

  1. With the project generator at https://code.quarkus.io/
  2. In a terminal with the Quarkus Maven plugin
  3. By manually creating the project and including the Quarkus dependencies and plugin configuration

Of these options, option 3 is the more complicated and prone to errors, so we won’t cover it in this book.

Note

Examples work with JDK 11 and Maven 3.8.1+.

Option 2 would use a command such as the following:

2.2 Developing with live coding

2.3 Writing a test

2.4 Creating a native executable

2.5 Running in Kubernetes

2.5.1 Generating Kubernetes YAML

2.5.2 Packaging an application

2.5.3 Deploying and running an application

Summary