Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Quarkus 4.0 Released: Java 21, Virtual Threads, HTTP/3, and Quarkus Data

Quarkus 4.0 upgrades to Java 21, Vert.x 5, Jackson 3, and introduces Quarkus Data for compile-time repository generation, optional HTTP/3 support, virtual threads for blocking REST endpoints, and built-in observability with @Observed annotation, plus migration tips and code examples.

Overview

Quarkus 4.0 was released on 2026-11-25 after roughly two years of preparation. The release is a planned foundation swap rather than a sudden breaking change. The minimum Java version is now 21 (with Java 25 recommended), the network layer moves to Eclipse Vert.x 5 and Netty 4.2, JSON processing switches to Jackson 3, CDI upgrades to 5.0, REST aligns with Jakarta REST 4, persistence moves to Jakarta Persistence 4.0 and Jakarta Data 1.1, and Hibernate ORM upgrades to 8.0. New features include Quarkus Data, optional HTTP/3, virtual thread integration for blocking REST endpoints, and an observability panel in the Dev UI.

Language and Network Foundation

Java 17 is no longer supported; default container images now use UBI 10. Vert.x 5 represents a major shift coordinated over nearly a year: the asynchronous model retains only Future, callback interfaces are removed. HTTP/3, QUIC, and production-ready io_uring support emerge from this layer. The gRPC extension is reimplemented on top of Vert.x. Most standard REST applications will not feel these changes directly, but projects using Vert.x clients, reactive SQL, or gRPC should consult the migration guide.

Jackson 3 and CDI 5

Jackson 3.1 is the most common upgrade pitfall. Annotations remain in the same packages, but other class packages and some default behaviors have changed. Deserialization mismatches and sudden date-format differences should be investigated here first.

CDI 5 introduces three new annotations: @Reserve: a default implementation that can be overridden by an application bean. Used when no ordinary bean is present. @Eager: creates the bean at application startup so it is ready before the first invocation. @AutoClose: if the bean implements AutoCloseable, the framework calls close() on destruction. @Reserve and @Eager have Quarkus-specific predecessors ( @DefaultBean and @Startup), now standardized.

Quarkus Data

Quarkus Data combines the convenience of Panache with Jakarta Data repository interfaces, supporting both blocking and reactive styles. Repository methods are implemented at compile time; query errors are caught during the build.

Entities can choose two session types: ManagedEntity: closer to traditional Hibernate — field changes are flushed to the database automatically. RecordEntity: uses a stateless session; insert(), update(), delete() execute immediately, offering a simpler mental model.

Quarkus Data cannot coexist with classic Panache in the same project (build fails). The extension is still experimental; class and package names may change. Suitable for new modules; for existing systems, migrate a small bounded context first.

Hibernate family upgrades together: ORM 8.0, Reactive 5.1, Search 9.0, Validator 9.2. The first three track candidate versions of Jakarta Persistence 4.0 and Jakarta Data 1.1; Quarkus will realign when specs finalize.

Initialization scripts are split: schema goes to schema.sql, data to data.sql. The legacy import.sql remains usable in dev/test but is deprecated.

HTTP/3, Virtual Threads, and Observability

Adding the quarkus-http3 extension enables HTTP/3 on the same port as HTTPS. HTTP/1.1 and HTTP/2 responses include an Alt-Svc header, letting clients decide whether to upgrade. Dev mode generates self-signed certificates via a TLS registry; REST Client and native executables work.

Virtual threads no longer require per-method @RunOnVirtualThread. A single build-time property routes blocking-style REST methods to virtual threads; non-blocking signatures stay on the event loop. Explicit @Blocking, @NonBlocking, or @RunOnVirtualThread annotations take precedence.

Observability gains quarkus-observation. Annotating a business method with @Observed emits timing metrics and a trace, compatible with Micrometer or OpenTelemetry. In dev mode, the Dev UI shows an Observability page with traces and metrics, exportable to CSV.

OpenTelemetry defaults shift toward production: sampling drops from 100% to 10%, OTLP protocol defaults to http/protobuf on port 4318. Local full tracing is restored by raising the sampling rate.

Security adds post-quantum key exchange support in the TLS registry; an experimental SPIFFE Client can fetch workload identities from a local SPIRE Agent. The Quarkus Agent MCP is now the recommended integration for AI coding assistants, launching quarkus dev and providing logs and version-specific documentation even before the application starts.

Hands-On Examples

Blocking REST on Virtual Threads

Enable virtual threads for blocking REST signatures with:

quarkus.rest.blocking.signatures.execution.mode=virtual-thread

Optionally add the HTTP/3 dependency:

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-http3</artifactId>
</dependency>

Repository Query with Quarkus Data

Entity using RecordEntity with an embedded repository interface:

package org.acme;

import io.quarkus.data.hibernate.RecordEntity;
import io.quarkus.data.hibernate.RecordRepository;
import jakarta.data.repository.Find;
import jakarta.data.repository.Query;
import jakarta.persistence.Entity;
import java.math.BigDecimal;
import java.util.List;

@Entity
public class Book extends RecordEntity {
    public String title;
    public BigDecimal price;

    public interface Repo extends RecordRepository<Book> {
        @Find
        List<Book> findByTitle(String title);

        @Query("where price < :maxPrice order by title")
        List<Book> cheaperThan(BigDecimal maxPrice);
    }
}

Service inserting and querying within a transaction:

package org.acme;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.QueryParam;
import java.math.BigDecimal;
import java.util.List;

@Path("/books")
@ApplicationScoped
public class BookResource {
    @Inject
    Book.Repo books;

    @Transactional
    public void add(String title, BigDecimal price) {
        Book book = new Book();
        book.title = title;
        book.price = price;
        book.insert();
    }

    @GET
    public List<Book> cheaper(@QueryParam("maxPrice") BigDecimal maxPrice) {
        return books.cheaperThan(maxPrice);
    }
}

Include the annotation processor quarkus-data-processor and the appropriate JDBC driver (e.g., quarkus-jdbc-postgresql).

Unified Metrics and Tracing with @Observed

Add quarkus-observation plus OpenTelemetry or Prometheus extensions. Annotate methods:

package org.acme;

import io.micrometer.observation.annotation.Observed;
import jakarta.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class OrderService {
    @Observed(name = "order.place", contextualName = "place-order")
    public Order place(String sku) {
        return new Order(sku);
    }
}

In dev mode, open the Dev UI Observability page to see traces and metrics instantly without a separate monitoring stack.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

ObservabilityQuarkusVirtual ThreadsJacksonJava 21HTTP/3Vert.xHibernateCDIQuarkus Data

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion