Quarkus - Guides

You have gone through the Getting Started guides. You are now ready to dive into specific topic guides.

Configuring Your Application

Hardcoded values in your code is a no go (even if we all did it at some point ;-)). In this guide, we learn how to configure your application.

READ THE GUIDE

Application Initialization and Termination

You often need to execute custom actions when the application starts and clean up everything when the application stops. This guide explains how to be notified when an application stops or starts.

READ THE GUIDE

Contexts and Dependency Injection

Quarkus DI solution is based on the Contexts and Dependency Injection for Java 2.0 specification. However, it is not a full CDI implementation verified by the TCK. Only a subset of the CDI features is implemented - see also the list of supported features and the list of limitations.

READ THE GUIDE

Testing Your Application

This guide covers:

  • Testing in JVM mode
  • Testing in native mode
  • Injection of resources into tests

READ THE GUIDE

Configuring Logging

This guide explains logging and how to configure it.

READ THE GUIDE

Using SSL With Native Images

In this guide, we will discuss how you can get your native images to support SSL, as native images don’t support it out of the box.

READ THE GUIDE


Web

Writing JSON REST Services

JSON is now the lingua franca between microservices. In this guide, we see how you can get your REST services to consume and produce JSON payloads.

READ THE GUIDE

Validation with Hibernate Validator

This guide covers how to use Hibernate Validator/Bean Validation in your REST services.

READ THE GUIDE

Using the REST Client

This guide explains how to use the MicroProfile REST Client in order to interact with REST APIs with very little effort.

READ THE GUIDE

Using JWT RBAC

This guide explains how your application can utilize {mp-jwt} to provide secured access to the JAX-RS endpoints.

READ THE GUIDE

Using WebSockets

This guide explains how your Quarkus application can utilize web sockets to create interactive web applications. Because it’s the canonical web socket application, we are going to create a simple chat application.

READ THE GUIDE

Using OpenAPI and Swagger UI

This guide explains how to use the OpenAPI extension to generate an OpenAPI descriptor and get a Swagger UI frontend to test your REST endpoints.

READ THE GUIDE


Data

Configuring your datasources

With Quarkus, you can easily configure a datasource, or several if need be.

READ THE GUIDE

Using Hibernate ORM and JPA

Hibernate ORM is the de facto JPA implementation and offers you the full breath of an Object Relational Mapper. It works beautifully in Quarkus.

READ THE GUIDE

Hibernate ORM and JPA with Panache

Hibernate ORM is the de facto JPA implementation and offers you the full breadth of an Object Relational Mapper. It makes complex mappings possible, but it does not make simple and common mappings trivial. Panache focuses on making your entities trivial and fun to write.

READ THE GUIDE

Using Infinispan Client

Infinispan is an in memory data grid that allows running in a server outside of application processes. This extension provides functionality to allow the client that can connect to said server when running in Quarkus.

READ THE GUIDE

Using Transactions

Quarkus comes with a Transaction Manager and uses it to coordinate and expose transactions to your applications. Each extension dealing with persistence will integrate with it for you. And you will explicitly interact with transactions via CDI. This guide will walk you through all that.

READ THE GUIDE

Validation with Hibernate Validator

This guide covers how to use Hibernate Validator/Bean Validation in your REST services.

READ THE GUIDE

Schema Migration with Flyway

This guide covers how to use the Flyway extension to manage your schema migrations.

READ THE GUIDE


Messaging

Using Kafka

This guide demonstrates how your Quarkus application can utilize MicroProfile Reactive Messaging to interact with Apache Kafka.

READ THE GUIDE

Asynchronous Message Passing

This guide explains how different beans can interact using asynchronous messages.

READ THE GUIDE


Security

Using Security

This quide demonstrates integration with the Elytron security subsystem to allow for RBAC based on the common security annotations @RolesAllowed, @DenyAll, @PermitAll on REST endpoints.

READ THE GUIDE

Using JWT RBAC

This guide explains how your application can utilize MicroProfile JWT RBAC to provide secured access to the JAX-RS endpoints.

READ THE GUIDE

Using Keycloak to Protect JAX-RS Applications

This guide demonstrates how your Quarkus application can use Keycloak to protect your JAX-RS applications using bearer token authorization, where these tokens are issued by a Keycloak Server.

READ THE GUIDE


Cloud

Deploying Native Applications on Kubernetes or OpenShift

This guide covers how to deploy a native application on Kubernetes or OpenShift.

READ THE GUIDE

Deploying Native Applications on Knative Kubernetes or OpenShift

This guide demonstrates how to deploy an application on Knative Kubernetes or OpenShift.

READ THE GUIDE

Generating Kubernetes resources

This guide demonstrates how generate Kubernetes resources using Quarkus Kubernetes extension.

READ THE GUIDE

Deploying to OpenShift using S2I

This guide explains how to deploy a Quarkus application to OpenShift using S2I.

READ THE GUIDE


Observability

Using Health Check

This guide demonstrates how your Quarkus application can utilize the MicroProfile Health specification through the SmallRye Health extension.

READ THE GUIDE

Using OpenTracing

This guide explains how your Quarkus application can utilize OpenTracing to provide distributed tracing for interactive web applications.

READ THE GUIDE

Collecting Metrics

This guide demonstrates how your Quarkus application can utilize the MicroProfile Metrics specification through the SmallRye Metrics extension.

READ THE GUIDE


Serialization

Writing JSON REST Services

JSON is now the lingua franca between microservices. In this guide, we see how you can get your REST services to consume and produce JSON payloads.

READ THE GUIDE


Tooling

Building Applications with Maven

This guide covers:

  • Maven configuration
  • Creating a new project
  • Dealing with extensions
  • Development mode
  • Debugging
  • Import in your IDE
  • Building a native image
  • Build a container friendly executable

READ THE GUIDE

Building Applications with Gradle

This guide covers:

  • Maven configuration
  • Creating a new project
  • Dealing with extensions
  • Development mode
  • Debugging
  • Import in your IDE
  • Building a native image
  • Build a container friendly executable

READ THE GUIDE


Migration

Using our Spring Dependency Injection compatibility layer

While you are encouraged to use CDI annotations for injection, Quarkus provides a compatibility layer for Spring dependency injection in the form of the spring-di extension.

READ THE GUIDE


Writing Extensions

Write Your Own Extension

Quarkus extensions add a new developer focused behavior to the core offering, and consist of two distinct parts, buildtime augmentation and runtime container. The augmentation part is responsible for all metadata processing, such as reading annotations, XML descriptors etc. The output of this augmentation phase is recorded bytecode which is responsible for directly instantiating the relevant runtime services.

This means that metadata is only processed once at build time, which both saves on startup time, and also on memory usage as the classes etc that are used for processing are not loaded (or even present) in the runtime JVM.

READ THE GUIDE

Writing Native Applications

This guide is a collection of tips to help you solve the problems you encounter when compiling applications to native executable.

READ THE GUIDE


Alternative Languages

Using Kotlin

This guide explains how to use Kotlin.

READ THE GUIDE


Miscellaneous

Measuring Performance

When measuring the footprint of a Quarkus application, we measure Resident Set Size (RSS) and not the JVM heap size which is only a small part of the overall problem. The JVM not only allocates native memory for heap (-Xms, -Xmx) but also structures required by the jvm to run your application.

READ THE GUIDE

Scheduling Periodic Tasks

Modern applications often need to run specific tasks periodically. In this guide, you learn how to schedule periodic tasks.

READ THE GUIDE

Using Vert.x

This guide explains how to use Vert.x in Quarkus to build reactive applications.

READ THE GUIDE