Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master themPractice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM levelTournamentsLive coding speed tournamentsArcade GamesZType, Overkill Survival, Glyphica & moreGamificationXP, coins, badges & quests
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFree ToolsWPM calculator, typing speed report & moreFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & missionSupportGet help — Pro users get priorityContactGet in touch with the team
Pricing
  1. Home
  2. /
  3. Learn
  4. /
  5. Quarkus

Learn Quarkus - 10 Code Examples & CST Typing Practice Test

Quarkus is a Kubernetes-native Java framework designed for building cloud-native, high-performance applications. It emphasizes fast startup times, low memory usage, and developer productivity.

View all 10 Quarkus code examples →
Quarkus Simple Counter APIQuarkus Hello World APIQuarkus Query Parameter ExampleQuarkus JSON Response ExampleQuarkus POST Form ExampleQuarkus Path Parameter ExampleQuarkus Error Handling ExampleQuarkus Redirect ExampleQuarkus Multiple Routes ExampleQuarkus Injected Bean Example

Learn QUARKUS with Real Code Examples

Updated Nov 25, 2025

Explain

Quarkus provides a modern framework for Java developers targeting cloud, microservices, and serverless architectures.

Optimized for GraalVM and HotSpot for fast startup and low memory footprint.

Supports reactive programming and imperative APIs.

Includes live reload for rapid development cycles.

Ideal for microservices, RESTful APIs, and event-driven applications.

Core Features

RESTful API development with JAX-RS

Dependency injection with CDI

Reactive streams and non-blocking I/O

Integration with databases via Panache

Cloud-native features like Kubernetes/OpenShift integration

Basic Concepts Overview

Quarkus application - core project structure

Endpoints - REST APIs using JAX-RS

CDI Beans - dependency-injected components

Reactive components - event-driven programming

Extensions - modular integrations for DB, messaging, etc.

Project Structure

src/main/java - application code

src/main/resources - configuration files

src/test/java - unit and integration tests

pom.xml / build.gradle - project configuration

extensions/ - modular integrations via Quarkus extensions

Building Workflow

Create Quarkus project using CLI or Maven/Gradle

Define REST endpoints with `@Path` and `@GET/POST`

Inject dependencies with `@Inject`

Add extensions for database, messaging, or security

Run in dev mode with hot reload for rapid iteration

Difficulty Use Cases

Beginner: simple REST endpoint

Intermediate: CRUD APIs with Panache ORM

Advanced: reactive microservices with Kafka/RabbitMQ

Expert: native image deployment with GraalVM

Auditor: performance tuning and monitoring

Comparisons

Quarkus vs Spring Boot: Quarkus faster startup and lower memory; Spring Boot more mature ecosystem

Quarkus vs Micronaut: Both cloud-native; Quarkus has more Red Hat support

Quarkus vs Vert.x: Vert.x is low-level reactive toolkit; Quarkus offers full-stack features

Quarkus vs Helidon: Helidon is micro-profile based; Quarkus emphasizes native images

Quarkus vs Node.js (Fastify): Java ecosystem vs Node.js, strong typing vs JS flexibility

Versioning Timeline

2019 - Quarkus initial release by Red Hat

2020 - Native image support and reactive programming enhancements

2021 - Expanded extension ecosystem and cloud-native integrations

2022 - Kubernetes/OpenShift optimizations

2023-2025 - Improved developer tools, GraalVM optimizations, and cloud-native support

Glossary

Quarkus app - core Java application instance

Endpoint - REST API path

CDI Bean - dependency-injected component

Extension - modular integration (DB, messaging, security)

Mutiny - reactive programming library

Installation Setup

Install Java 17+

Set up Maven or Gradle build system

Generate project via Quarkus CLI (`quarkus create`) or code.quarkus.io

Run development server with `./mvnw quarkus:dev`

Build native image with `./mvnw package -Pnative`

Environment Setup

Install Java 17+

Install Maven or Gradle

Install Quarkus CLI (optional)

Verify GraalVM for native builds

Run dev server and verify endpoints

Config Files

pom.xml / build.gradle - build configuration

application.properties / application.yaml - configuration

src/main/java - Java source code

src/main/resources - static and config files

src/test/java - test cases

Cli Commands

mvn io.quarkus:quarkus-maven-plugin:create -> create project

./mvnw quarkus:dev -> run dev server

./mvnw package -Pnative -> build native image

mvn test -> run tests

docker build -> containerize application

Internationalization

Use third-party libraries for i18n

Supports UTF-8

Serve locale-specific content

Integrates with message bundles

Suitable for multi-language applications

Accessibility

Supports CORS

Accessible via HTTP clients

Works on all JVM platforms

Middleware/extensions handle security headers

Cloud-native friendly

Ui Styling

Backend-only framework

Serve JSON APIs

Optionally serve static content

Integrate with SPA frontends

No native template engine, but supports Qute

State Management

Stateless REST services by default

Persistent state via DB or cache

Background tasks via reactive/event-driven streams

Session management with JWT/OAuth2

Clustered state via cloud platforms

Data Management

Map requests/responses with JSON-B or Jackson

Validate data via Bean Validation (Hibernate Validator)

Integrate with SQL/NoSQL databases

Cache frequently accessed data

Log requests/responses for observability

Architecture

Built on Java and GraalVM

CDI-based dependency injection

Reactive programming with Mutiny

REST endpoints with JAX-RS

Modular extensions for integration with DB, Kafka, etc.

Rendering Model

Client sends HTTP request -> Quarkus app

CDI beans and extensions process request

Endpoint handles business logic (reactive or imperative)

Response serialized to JSON or other formats

Response sent back to client

Architectural Patterns

CDI dependency injection

Reactive programming with Mutiny

REST endpoints with JAX-RS

Modular extensions for integrations

Cloud-native deployment patterns

Real World Architectures

Cloud-native microservices

Reactive backend for IoT apps

Serverless functions

Event-driven messaging systems

Kubernetes/OpenShift-based applications

Design Principles

Cloud-native and container-first

Fast startup and low memory footprint

Reactive-first programming model

Developer productivity via live reload

Extensible via modular extensions

Scalability Guide

Use reactive endpoints for high concurrency

Deploy multiple instances in Kubernetes/OpenShift

Leverage native images for fast scaling

Cache data and use messaging systems for decoupling

Monitor performance via metrics extensions

Migration Guide

Migrate from Spring Boot using Quarkus extensions

Rewrite REST endpoints using JAX-RS

Replace Spring Beans with CDI Beans

Adapt reactive programming where applicable

Test thoroughly for GraalVM native image compatibility

Performance Notes

Native images reduce startup time to milliseconds

Low memory footprint for containerized environments

Reactive endpoints handle high concurrency efficiently

Hot reload improves developer iteration speed

Optimized for cloud-native performance patterns

Security Notes

Use HTTPS and OAuth2 for secure communication

Leverage Quarkus security extensions

Sanitize and validate inputs in REST endpoints

Secure native images and container deployments

Regularly update dependencies to mitigate vulnerabilities

Monitoring Analytics

Built-in metrics via SmallRye

Monitor CPU/memory and request metrics

Integration with Prometheus/Grafana

Logging via JBoss Logging or SLF4J

Profile native images for performance

Code Quality

Follow Java best practices

Use dependency injection consistently

Write unit and integration tests

Document endpoints and extensions

Use reactive patterns appropriately

Practical Examples

REST API for an e-commerce backend

Reactive messaging with Kafka

CRUD application using Panache ORM

Serverless function deployed to OpenShift/Kubernetes

Event-driven IoT backend

Troubleshooting

Ensure correct Java version (17+)

Verify Maven/Gradle build configuration

Check extension versions for compatibility

Validate reactive streams for non-blocking errors

Monitor logs for native image compilation issues

Testing Guide

Use JUnit for unit testing

Use RestAssured for integration testing

Mock external services with Mockito

Test reactive streams with Mutiny utilities

Run native image tests for performance validation

Deployment Options

Deploy to Kubernetes/OpenShift

Package as Docker container

Native image deployment via GraalVM

Cloud serverless deployment

Use CI/CD pipelines for automated deployment

Tools Ecosystem

Java 17+ runtime

Maven/Gradle for build and dependency management

Quarkus CLI for project creation

Test frameworks: JUnit, RestAssured, Mockito

Extensions for DB, messaging, and security

Integrations

Relational databases (PostgreSQL, MySQL) via Panache

NoSQL databases (MongoDB, Redis)

Messaging (Kafka, AMQP)

Cloud-native platforms (Kubernetes, OpenShift)

Security frameworks (Keycloak, OAuth2)

Productivity Tips

Use Quarkus dev mode for rapid development

Leverage extensions for DB, messaging, security

Write reactive endpoints for scalable apps

Use GraalVM for native image optimization

Automate CI/CD deployment pipelines

Challenges

Mastering reactive programming in Java

Building and testing native images

Optimizing performance for cloud-native apps

Integrating multiple Quarkus extensions

Securing microservices with OAuth2/JWT

Learning Path

Learn Java 17+ basics

Understand Quarkus application structure

Learn JAX-RS for REST endpoints

Work with CDI and dependency injection

Deploy native images to Kubernetes/OpenShift

Skill Improvement Plan

Week 1: Java and Maven fundamentals

Week 2: REST endpoints with JAX-RS

Week 3: Dependency injection and CDI beans

Week 4: Reactive programming and Mutiny

Week 5: Native image compilation and cloud deployment

Interview Questions

What is Quarkus and why use it?

Explain Quarkus native images

How does Quarkus support reactive programming?

Describe Quarkus extensions and dependency injection

Compare Quarkus with Spring Boot

Cheat Sheet

mvn io.quarkus:quarkus-maven-plugin:create -> create project

@Path('/endpoint') -> define REST endpoint

@GET/@POST -> define HTTP methods

@Inject -> inject CDI bean

./mvnw quarkus:dev -> run dev server with live reload

Books

Quarkus Cookbook

Mastering Quarkus

Reactive Java with Quarkus

Cloud-Native Java with Quarkus

High-Performance Microservices with Quarkus

Tutorials

Getting started with Quarkus

Build REST APIs with JAX-RS

Reactive programming with Mutiny

Deploy Quarkus apps to Kubernetes/OpenShift

Create native images with GraalVM

Official Docs

https://quarkus.io/

https://github.com/quarkusio/quarkus

Community Links

Quarkus GitHub

Red Hat Developer community

StackOverflow Quarkus questions

Reddit r/quarkus

YouTube Quarkus tutorials

Community Support

Quarkus GitHub

Red Hat Developer community

StackOverflow Quarkus questions

Reddit r/quarkus

Official documentation and tutorials

Monetization

Enterprise microservices

SaaS backends

Event-driven and streaming services

Serverless cloud functions

Containerized production workloads

Future Roadmap

Expanded cloud-native and Kubernetes support

Improved reactive and event-driven patterns

More developer tooling and extensions

Better observability and monitoring

Continued optimization for GraalVM native images

When Not To Use

Small scripts or lightweight apps not needing Java

Applications where fast startup is not critical

Teams unfamiliar with Java or reactive programming

Projects requiring heavy server-side rendering templates

Legacy monolithic apps not targeting cloud-native

Final Summary

Quarkus is a cloud-native Java framework optimized for fast startup and low memory usage.

Supports reactive and imperative programming.

Extensive extension ecosystem allows easy integration with DB, messaging, and security.

Live reload enhances developer productivity.

Ideal for microservices, serverless, and Kubernetes/OpenShift deployments.

Faq

Is Quarkus free?

Yes - open-source under Apache License 2.0

Does Quarkus support native images?

Yes - via GraalVM and Quarkus build tools

Is Quarkus suitable for production?

Yes - optimized for cloud-native and microservices

Does Quarkus support reactive programming?

Yes - via Mutiny and reactive extensions

How does Quarkus compare to Spring Boot?

Quarkus has faster startup, lower memory, and cloud-native optimizations; Spring Boot has more mature ecosystem

Code Sample Descriptions

1

Quarkus Simple Counter API

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/counter")
public class CounterResource {
    private int count = 0

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public int getCount() {
        return count
    }

    @POST
    @Path("/increment")
    @Produces(MediaType.APPLICATION_JSON)
    public int increment() {
        return ++count
    }

    @POST
    @Path("/decrement")
    @Produces(MediaType.APPLICATION_JSON)
    public int decrement() {
        return --count
    }

    @POST
    @Path("/reset")
    @Produces(MediaType.APPLICATION_JSON)
    public int reset() {
        count = 0
        return count
    }
}

Demonstrates a simple Quarkus REST API with a counter using JAX-RS annotations and in-memory state.

Let’s Try →
2

Quarkus Hello World API

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/hello")
public class HelloResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello, Quarkus!"
    }
}

A minimal Quarkus REST API returning Hello World.

Let’s Try →
3

Quarkus Query Parameter Example

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/greet")
public class GreetResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String greet(@QueryParam("name") String name) {
        return "Hello, " + (name != null ? name : "Guest")
    }
}

Demonstrates query parameters in Quarkus REST API.

Let’s Try →
4

Quarkus JSON Response Example

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped
import java.util.Map

@ApplicationScoped
@Path("/json")
public class JsonResource {
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Map<String, String> json() {
        return Map.of("message", "Hello, Quarkus JSON")
    }
}

Return JSON response from Quarkus REST API.

Let’s Try →
5

Quarkus POST Form Example

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/form")
public class FormResource {
    @POST
    @Produces(MediaType.TEXT_PLAIN)
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public String handleForm(@FormParam("name") String name) {
        return "Hello, " + name
    }
}

Handle POST requests with form parameters.

Let’s Try →
6

Quarkus Path Parameter Example

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/user")
public class UserResource {
    @GET
    @Path("/{id}")
    @Produces(MediaType.TEXT_PLAIN)
    public String getUser(@PathParam("id") String id) {
        return "User ID: " + id
    }
}

Use path parameters in Quarkus REST API.

Let’s Try →
7

Quarkus Error Handling Example

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/error")
public class ErrorResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String error() {
        throw new WebApplicationException("This is an error", 400)
    }
}

Demonstrates basic exception handling in Quarkus.

Let’s Try →
8

Quarkus Redirect Example

import javax.ws.rs.*
import javax.ws.rs.core.Response
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("/redirect")
public class RedirectResource {
    @GET
    public Response redirect() {
        return Response.seeOther(URI.create("/counter")).build()
    }
}

Redirect request to another endpoint.

Let’s Try →
9

Quarkus Multiple Routes Example

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped

@ApplicationScoped
@Path("")
public class MultiResource {
    @GET
    @Path("/")
    @Produces(MediaType.TEXT_PLAIN)
    public String home() {
        return "Home"
    }

    @GET
    @Path("/about")
    @Produces(MediaType.TEXT_PLAIN)
    public String about() {
        return "About"
    }
}

Handle multiple routes in one Quarkus application.

Let’s Try →
10

Quarkus Injected Bean Example

import javax.ws.rs.*
import javax.ws.rs.core.MediaType
import javax.enterprise.context.ApplicationScoped
import javax.inject.Inject

@ApplicationScoped
@Path("/bean")
public class BeanResource {
    @Inject
    CounterService service

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getCount() {
        return "Count: " + service.getCount()
    }
}

@ApplicationScoped
class CounterService {
    private int count = 0
    public int getCount() { return count }
    public int increment() { return ++count }
}

Use CDI to inject a bean into a Quarkus REST API.

Let’s Try →

Frequently Asked Questions about Quarkus

What is Quarkus?

Quarkus is a Kubernetes-native Java framework designed for building cloud-native, high-performance applications. It emphasizes fast startup times, low memory usage, and developer productivity.

What are the primary use cases for Quarkus?

Microservices development. RESTful APIs with JAX-RS. Serverless functions and cloud-native apps. Reactive event-driven applications. Integration with Kubernetes and OpenShift

What are the strengths of Quarkus?

Extremely fast startup and low memory footprint. Developer-friendly live reload. Supports both reactive and imperative programming. Rich extension ecosystem for integrations. Optimized for containerized/cloud-native deployments

What are the limitations of Quarkus?

Java-specific - not suitable for other languages. Steeper learning curve for reactive programming. Requires understanding GraalVM for native images. Less mature compared to Spring ecosystem for some features. Initial configuration can be complex for beginners

How can I practice Quarkus typing speed?

CodeSpeedTest offers 10+ real Quarkus code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.

Learn Other Programming Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypherGremlinPartiqlHaskellElixirFsharpView all languages →
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Legal & Support

Pro ⚡ PricingContactPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.