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

Adding web content to Quarkus applications

In the examples we've discussed so far, we've tested the web server capabilities of Quarkus by adding RESTful services. Under the hood, Quarkus uses the following core components to handle web requests:

  • Vert.x Web server: It is the core web component in Quarkus delivering RESTful services as long as real-time (server push) web applications. We will discuss more in detail about Vert.x in Chapter 9, Unifying Imperative and Reactive with Vert.x of this book.
  • Undertow Web server: It is a flexible product, built by combining different small single-purpose handlers, that comes into play in Quarkus when delivering WebSocket applications.

As already discussed, we can add static web content (HTML, JavaScript, images) to our applications by including them under the resources/META-INF/resources folder of your project. What is the purpose...