Quarkus Tutorial
Learn Quarkus step by step: 36 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Quarkus? Meet Quarkus, the Kubernetes-native Java framework: what problem it solves, how it differs from Spring Boot, its main ideas and when to choose it.
- Creating a Quarkus Project Create your first Quarkus project with the CLI, Maven or code.quarkus.io, understand the generated files, the pom.xml and the standard directory layout.
- Your First Endpoint and Live Coding Write your first Quarkus REST endpoint, run it in dev mode, change code without restarting, use the Dev UI and write the first test for the greeting.
- Extensions and the BOM Learn what Quarkus extensions are, how runtime and deployment modules differ, how the BOM manages versions, and how to find, add and choose extensions.
- Build-Time Architecture Understand how Quarkus does its work at build time: Jandex indexing, augmentation, recorders, closed-world assumptions and what they mean for your code.
Dependency Injection and CDI
- CDI Beans and Injection Learn dependency injection in Quarkus with CDI: what a bean is, how @Inject works with constructors and fields, how ArC resolves types and common errors.
- Bean Scopes in Quarkus Learn how Quarkus CDI scopes control bean lifetime: @ApplicationScoped, @Singleton, @RequestScoped, @Dependent, client proxies, lazy creation and common pitfalls.
- Qualifiers, Producers and Alternatives Resolve ambiguous beans in Quarkus: custom qualifiers, @Named, producer methods and fields, disposers, @DefaultBean, @Alternative and build-time conditions.
- Interceptors and Decorators Add logging, timing, security and retries to Quarkus beans without touching their code: interceptor bindings, @AroundInvoke, priorities, decorators and stereotypes.
- Events and Bean Lifecycle Decouple Quarkus components with CDI events and observers, run code at startup and shutdown with StartupEvent and @Startup, and use @PostConstruct and @PreDestroy.
REST Endpoints
- REST Resources and Methods Build REST endpoints in Quarkus: resource classes, @Path templates, HTTP method annotations, @RestPath and @RestQuery, content types and status codes.
- JSON and Bean Validation Serialize records to JSON, customize Jackson in Quarkus, and validate request bodies with Bean Validation annotations, @Valid and automatic 400 responses.
- Exception Mappers and Error Responses Turn exceptions into clean HTTP error responses in Quarkus with @ServerExceptionMapper, WebApplicationException, ExceptionMapper and a consistent JSON problem format.
- REST Client and Filters Call other HTTP services from Quarkus with the type-safe REST Client, add request and response filters, and protect calls with timeouts, retries and fallbacks.
- OpenAPI and Swagger UI Generate an OpenAPI document and Swagger UI from your Quarkus REST endpoints, enrich it with annotations, serve it in dev mode and use it for client generation.
Data with Panache
- Hibernate ORM with Panache Set up a database in Quarkus with Hibernate ORM and Panache: datasource config, Dev Services, active record entities, persist, find, delete and the persistence context.
- Panache Repositories and Queries Use PanacheRepository in Quarkus, write short HQL queries with positional and named parameters, sort, page results, count, update and delete in bulk.
- Relationships, N+1 and DTO Projections Map @ManyToOne and @OneToMany in Quarkus, avoid the N+1 query problem with join fetch, and return DTO records or projections instead of entities.
- Transactions and Flyway Migrations Use @Transactional in Quarkus, learn when a transaction rolls back, and manage the database schema with Flyway migrations instead of drop-and-create.
Config and Profiles
- Configuration Properties and Profiles Read settings in Quarkus with @ConfigProperty and application.properties, switch values with the %dev, %test and %prod profiles, and learn the source order.
- Typed Configuration with @ConfigMapping Group related Quarkus settings into a type-safe interface with @ConfigMapping, nested groups, defaults, lists, maps and Bean Validation, then inject it anywhere.
- Secrets, Custom Sources and Config in Production Keep passwords out of Git: use environment variables, .env files, Kubernetes secrets and config maps, custom ConfigSource classes and secret-safe logging in Quarkus.
Reactive and Messaging
- Mutiny: Uni and Multi Learn Mutiny, the reactive library of Quarkus: Uni for one item, Multi for streams, map and flatMap, failure recovery, subscription and backpressure explained.
- The Event Loop, Blocking Code and Virtual Threads Understand the Vert.x event loop under Quarkus, which endpoints run on I/O or worker threads, how @Blocking and @RunOnVirtualThread work and how to avoid stalls.
- Reactive Messaging with Kafka and AMQP Build event-driven Quarkus services with SmallRye Reactive Messaging: @Incoming, @Outgoing, Emitter, channels, Kafka configuration, acknowledgment and dead letters.
Native Images and Dev Mode
- Dev Mode, Live Reload and Dev Services Use quarkus dev for instant live reload, continuous testing, the Dev UI and Dev Services that start databases, Kafka and more in containers with zero configuration.
- How Quarkus Works: Build-Time Processing Learn why Quarkus starts fast and uses little memory: build steps, the Jandex index, generated bytecode, ArC dependency injection and the closed-world principle.
- Native Images with GraalVM and Mandrel Compile a Quarkus app to a native executable with GraalVM or Mandrel: build commands, container builds, reflection and resource registration, limits and when to use it.
Testing and Deployment
- Testing with @QuarkusTest and REST Assured Test Quarkus applications with @QuarkusTest, REST Assured, injection into tests, @TestTransaction and Dev Services databases, plus integration tests of the packaged app.
- Mocks, Test Profiles and Test Resources Replace beans with @InjectMock and alternatives, change configuration per test class with QuarkusTestProfile, start fakes with test resources and use the in-memory connector.
- Health Checks, Metrics and Tracing Make a Quarkus service observable: SmallRye Health liveness and readiness probes, Micrometer metrics for Prometheus, OpenTelemetry traces and structured logs.
- Security with JWT and OpenID Connect Secure a Quarkus API: protect endpoints with @RolesAllowed and permission rules, validate JWT bearer tokens with SmallRye JWT or OIDC, and test with Keycloak Dev Services.
- Containers, Kubernetes and Deployment Package a Quarkus app as a container image with Jib or Docker, generate Kubernetes manifests from application.properties, tune JVM memory and deploy with probes.
Projects and Practice
- Project: A Bookshop REST API Build a complete Quarkus bookshop API: project setup, Panache entity, REST resource, validation, error mapping, tests, health checks and container image, with a runnable model.
- Project: An Event-Driven Order Pipeline Design an event-driven order pipeline in Quarkus: orders, inventory and invoices connected by Kafka topics, with partitions, consumer groups, the outbox pattern and dead letters.
- Migrating from Spring Boot to Quarkus Move a Spring Boot service to Quarkus: annotation and config mapping, the Spring compatibility extensions, Panache versus Spring Data, tests, pitfalls and a safe step plan.