Book Image

Hands-On Cloud-Native Applications with Java and Quarkus

By : Francesco Marchioni
Book Image

Hands-On Cloud-Native Applications with Java and Quarkus

By: Francesco Marchioni

Overview of this book

Quarkus is a new Kubernetes-native framework that allows Java developers to combine the power of containers, microservices, and cloud-native to build reliable applications. The book is a development guide that will teach you how to build Java-native applications using Quarkus and GraalVM. We start by learning about the basic concepts of a cloud-native application and its advantages over standard enterprise applications. Then we will quickly move on to application development, by installing the tooling required to build our first application on Quarkus. Next, we’ll learn how to create a container-native image of our application and execute it in a Platform-as-a-Service environment such as Minishift. Later, we will build a complete real-world application that will use REST and the Contexts and Dependency injection stack with a web frontend. We will also learn how to add database persistence to our application using PostgreSQL. We will learn how to work with various APIs available to?Quarkus?such as Camel, Eclipse MicroProfile, and Spring DI. Towards the end, we will learn advanced development techniques such as securing applications, application configuration, and working with non-blocking programming models using Vert.x. By the end of this book, you will be proficient with all the components of Quarkus and develop-blazing fast applications leveraging modern technology infrastructure.
Table of Contents (15 chapters)
Free Chapter
Section 1: Getting Started with Quarkus
Section 2: Building Applications with Quarkus
Section 3: Advanced Development Tactics

What this book covers

Chapter 1, Introduction to Quarkus Core Concepts, explains the container-first (minimal-footprint Java applications are optimal for running in containers), cloud-native (Quarkus embraces the 12-factor architecture of environments such as Kubernetes), and microservice-first (Quarkus brings lightning-fast start up times and code turnaround times to Java apps) approaches. We will examine the various tools available for developing Quarkus applications. For this, we will install an IDE and GraalVM, which is required for native applications.

Chapter 2, Developing Your First Application with Quarkus, takes you through building your first application with Quarkus. We will see how to use Maven/Gradle plugins to bootstrap your application. You will learn how to import the application in your IDS, and how to run and test the application. Next, we will discuss creating a native application from your Java project.

Chapter 3, Creating a Container Image of Your Application, looks at how to build a Docker image of your application, how to run an application on Docker, how to install a single-node cluster of OpenShift, and how to run an application on Minishift.

Chapter 4, Web Application Development, looks at the use case of a customer store application that will use REST and the CDI stack and a web frontend. We will see how to deploy the application and see changes without restarting Quarkus.

Chapter 5, Managing Data Persistence with Quarkus, discusses data persistence with Quarkus. We will see how to add persistence to the customer store example as well as setting up a database (PostgreSQL) to run the example. We will then take the application to the cloud. Finally, we will show you how Hibernate Panache can simplify application development.

Chapter 6, Building Applications Using the MicroProfile API, teaches you how to complement the Enterprise API that we have already discussed with the full stack of Eclipse MicroProfile specifications (

Chapter 7, Securing Applications, will explore how to secure our example application with built-in security APIs such as the Elytron Security stack, the Keycloak extension, and the MicroProfile JWT extension.

Chapter 8, Advanced Application Development, gets into advanced application development techniques such as advanced application configuration management, life cycle events, and firing scheduled tasks.

Chapter 9, Unifying Imperative and Reactive, takes you through the non-blocking programming model with Quarkus and an example application using the Vert.x programming model with Quarkus. We will also explore how to leverage Vert.x's reactive SQL API to build non-blocking database applications.

Chapter 10, Reactive Messaging with Quarkus, explains how to implement reactive data streaming applications using a CDI development model and Kafka and AMQP as a broker. We will also explain how to implement a full streaming architecture in the cloud by deploying our application on OpenShift.