Cloud Native, Container First Java framework for building efficient Java applications with fast startup times and low memory usage
npx @tessl/cli install tessl/maven-io-quarkus--quarkus-bom@3.26.0Quarkus is a Cloud Native, Container First framework for writing Java applications. It's designed for optimal performance in containerized environments, providing lightning-fast startup times and low memory usage while embracing established standards and frameworks like JAX-RS, JPA, Netty, Vert.x, and MicroProfile.
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>3.26.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>Main application entry points:
import io.quarkus.runtime.Quarkus;
import io.quarkus.runtime.QuarkusApplication;
import io.quarkus.runtime.annotations.QuarkusMain;CDI and dependency injection:
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import io.quarkus.arc.Arc;Configuration:
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.quarkus.arc.config.ConfigProperties;import io.quarkus.runtime.Quarkus;
import io.quarkus.runtime.QuarkusApplication;
import io.quarkus.runtime.annotations.QuarkusMain;
@QuarkusMain
public class Main {
public static void main(String... args) {
Quarkus.run(HelloApp.class, args);
}
public static class HelloApp implements QuarkusApplication {
@Override
public int run(String... args) throws Exception {
System.out.println("Hello from Quarkus application!");
Quarkus.waitForExit();
return 0;
}
}
}REST endpoint example:
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
@Path("/hello")
public class GreetingResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "Hello from Quarkus!";
}
}Quarkus follows a build-time optimization approach:
This design enables Quarkus applications to start in milliseconds and consume minimal memory, making them ideal for microservices, serverless, and cloud-native deployments.
Foundation classes for Quarkus applications including main entry points, lifecycle management, and core annotations for build-time processing.
public class Quarkus {
public static void run(Class<? extends QuarkusApplication> application, String... args);
public static void waitForExit();
public static void asyncExit();
}
public interface QuarkusApplication {
int run(String... args) throws Exception;
}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface QuarkusMain {
String name() default "";
}Core Runtime and Application Lifecycle
ArC CDI container providing dependency injection, context management, and lifecycle handling with build-time optimization and native image support.
public class Arc {
public static ArcContainer container();
public static boolean isStarted();
}
public interface ArcContainer {
<T> InstanceHandle<T> instance(Class<T> type, Annotation... qualifiers);
<T> InjectableInstance<T> select(Class<T> type, Annotation... qualifiers);
}JAX-RS implementation with RESTEasy Reactive for building high-performance REST APIs with full OpenAPI integration and native compilation support.
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Path {
String value();
}
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface GET {}
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface POST {}MicroProfile Config implementation with build-time resolution, type-safe configuration mapping, and support for multiple configuration sources.
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ConfigProperty {
String name() default "";
String defaultValue() default ConfigProperty.UNCONFIGURED_VALUE;
}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface ConfigMapping {
String prefix() default "";
}Hibernate ORM integration with Panache for simplified data access, transaction management, and support for both imperative and reactive database operations.
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Entity {}
public class PanacheEntity {
public void persist();
public void delete();
public static <T extends PanacheEntity> List<T> listAll();
public static <T extends PanacheEntity> T findById(Object id);
}Comprehensive security framework with support for OIDC, JWT, RBAC, and integration with various authentication providers and security standards.
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface RolesAllowed {
String[] value();
}
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface PermitAll {}
public interface QuarkusSecurityIdentity extends SecurityIdentity {
Principal getPrincipal();
Set<String> getRoles();
}Reactive programming model with Mutiny, reactive messaging, and event-driven architecture support for building scalable asynchronous applications.
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Incoming {
String value();
}
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Outgoing {
String value();
}
public class Uni<T> {
public static <T> Uni<T> createFrom();
public Uni<Void> subscribe();
public <R> Uni<R> map(Function<? super T, ? extends R> mapper);
}JUnit 5 integration with Quarkus-specific testing annotations, mocking support, and test profiles for comprehensive application testing.
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface QuarkusTest {}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface QuarkusIntegrationTest {}
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface TestProfile {
Class<? extends QuarkusTestProfile> value();
}Cron-like scheduling capabilities with programmatic scheduler access and comprehensive lifecycle event handling for background task management.
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Scheduled {
String cron() default "";
String every() default "";
long delay() default -1;
TimeUnit delayUnit() default TimeUnit.MILLISECONDS;
}
public interface Scheduler {
void pause();
void resume();
boolean isRunning();
}Scheduling and Background Tasks
// Core application lifecycle
public interface QuarkusApplication {
int run(String... args) throws Exception;
}
// CDI container interfaces
public interface ArcContainer {
<T> InstanceHandle<T> instance(Class<T> type, Annotation... qualifiers);
<T> InjectableInstance<T> select(Class<T> type, Annotation... qualifiers);
}
public interface InstanceHandle<T> extends AutoCloseable {
T get();
void destroy();
}
// Configuration interfaces
public interface ConfigMapping {
String prefix() default "";
}
// Security interfaces
public interface QuarkusSecurityIdentity extends SecurityIdentity {
Principal getPrincipal();
Set<String> getRoles();
<T> Attribute<T> getAttribute(String name);
}
// Reactive types
public class Uni<T> {
public static <T> Uni<T> createFrom();
public Uni<Void> subscribe();
public <R> Uni<R> map(Function<? super T, ? extends R> mapper);
public <R> Uni<R> flatMap(Function<? super T, Uni<? extends R>> mapper);
}
public class Multi<T> {
public static <T> Multi<T> createFrom();
public Multi<T> filter(Predicate<? super T> predicate);
public <R> Multi<R> map(Function<? super T, ? extends R> mapper);
}
// Testing interfaces
public interface QuarkusTestProfile {
Map<String, String> getConfigOverrides();
Set<Class<?>> getEnabledAlternatives();
String getConfigProfile();
}
// Scheduler interfaces
public interface ScheduledExecution {
String getIdentity();
Instant getScheduledFireTime();
Instant getPreviousFireTime();
}