Convert Figma logo to code with AI

quarkusio logoquarkus

Quarkus: Supersonic Subatomic Java.

13,702
2,658
13,702
2,582

Top Related Projects

Spring Boot

Micronaut Application Framework

14,281

Vert.x is a tool-kit for building reactive applications on the JVM

3,481

Java libraries for writing microservices

20,301

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀

19,604

JDK main-line development https://openjdk.org/projects/jdk

Quick Overview

Quarkus is a Kubernetes-native Java framework tailored for OpenJDK HotSpot and GraalVM, designed for building fast, lightweight microservices and serverless applications. It offers a container-first approach to Java application development, focusing on low memory usage and fast startup times.

Pros

  • Extremely fast startup time and low memory footprint
  • Optimized for GraalVM and native compilation
  • Extensive set of extensions for easy integration with popular libraries and frameworks
  • Developer-friendly with live coding capabilities and unified configuration

Cons

  • Relatively new compared to established frameworks like Spring Boot
  • Limited documentation and community resources compared to more mature frameworks
  • Steeper learning curve for developers accustomed to traditional Java frameworks
  • Some limitations when using certain Java libraries in native mode

Code Examples

  1. Simple REST endpoint:
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/hello")
public class GreetingResource {

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello from Quarkus";
    }
}
  1. Reactive programming with Mutiny:
import io.smallrye.mutiny.Uni;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/reactive")
public class ReactiveResource {

    @GET
    public Uni<String> hello() {
        return Uni.createFrom().item("Hello Reactive Quarkus");
    }
}
  1. Dependency injection with CDI:
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

@ApplicationScoped
public class GreetingService {

    @Inject
    NameService nameService;

    public String greet() {
        return "Hello, " + nameService.getName();
    }
}

Getting Started

  1. Install the Quarkus CLI:
curl -Ls https://sh.jbang.dev | bash -s - trust add https://repo1.maven.org/maven2/io/quarkus/quarkus-cli/
curl -Ls https://sh.jbang.dev | bash -s - app install --fresh --force quarkus@quarkusio
  1. Create a new Quarkus project:
quarkus create app my-quarkus-project
cd my-quarkus-project
  1. Run the application in dev mode:
quarkus dev

Your Quarkus application is now running at http://localhost:8080.

Competitor Comparisons

Spring Boot

Pros of Spring Boot

  • Mature ecosystem with extensive documentation and community support
  • Wide range of integrations and starter dependencies
  • Excellent tooling support, including Spring Tool Suite and IDE plugins

Cons of Spring Boot

  • Larger memory footprint and slower startup times
  • More complex configuration for advanced use cases
  • Steeper learning curve for beginners due to its extensive feature set

Code Comparison

Spring Boot:

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

Quarkus:

@QuarkusMain
public class Application {
    public static void main(String... args) {
        Quarkus.run(args);
    }
}

Both frameworks aim to simplify Java application development, but they differ in their approach. Spring Boot focuses on providing a comprehensive ecosystem with a wide range of features, while Quarkus emphasizes fast startup times and low memory usage, making it particularly suitable for cloud-native and serverless applications.

Spring Boot's maturity and extensive ecosystem make it a popular choice for enterprise applications, while Quarkus's performance optimizations and native compilation support make it attractive for microservices and containerized deployments.

Micronaut Application Framework

Pros of Micronaut

  • Faster startup time and lower memory footprint
  • Built-in support for serverless and cloud-native applications
  • Extensive support for reactive programming

Cons of Micronaut

  • Smaller ecosystem and community compared to Quarkus
  • Less extensive documentation and learning resources
  • Fewer integrations with enterprise Java technologies

Code Comparison

Micronaut:

@Controller("/hello")
public class HelloController {
    @Get("/{name}")
    public String hello(String name) {
        return "Hello, " + name + "!";
    }
}

Quarkus:

@Path("/hello")
public class HelloResource {
    @GET
    @Path("/{name}")
    @Produces(MediaType.TEXT_PLAIN)
    public String hello(@PathParam String name) {
        return "Hello, " + name + "!";
    }
}

Both frameworks offer similar syntax for creating RESTful endpoints, but Micronaut uses Spring-like annotations while Quarkus follows JAX-RS standards. Micronaut's approach is more concise, while Quarkus aligns more closely with traditional Java EE practices.

14,281

Vert.x is a tool-kit for building reactive applications on the JVM

Pros of Vert.x

  • Lightweight and flexible, allowing for more granular control over application architecture
  • Supports multiple programming languages, not limited to Java
  • Mature project with a long history and established ecosystem

Cons of Vert.x

  • Steeper learning curve, especially for developers new to reactive programming
  • Less opinionated, requiring more manual configuration and setup
  • Lacks some of the out-of-the-box features and integrations provided by Quarkus

Code Comparison

Vert.x:

Vertx vertx = Vertx.vertx();
vertx.createHttpServer().requestHandler(req -> {
  req.response().putHeader("content-type", "text/plain").end("Hello from Vert.x!");
}).listen(8080);

Quarkus:

@Path("/hello")
public class GreetingResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello from Quarkus!";
    }
}

Vert.x offers a more low-level approach, giving developers direct control over server creation and request handling. Quarkus, on the other hand, provides a higher-level abstraction with JAX-RS annotations, simplifying the process of creating RESTful endpoints.

3,481

Java libraries for writing microservices

Pros of Helidon

  • Lightweight and modular design, allowing for faster startup times and lower memory footprint
  • Strong support for reactive programming models, particularly with Helidon Nima
  • Seamless integration with Oracle Cloud Infrastructure (OCI) services

Cons of Helidon

  • Smaller community and ecosystem compared to Quarkus
  • Less extensive documentation and fewer examples available
  • Limited native image support compared to Quarkus' GraalVM integration

Code Comparison

Helidon (Reactive WebServer):

Routing.builder()
    .get("/greet", (req, res) -> res.send("Hello, World!"))
    .build();
WebServer.create(routing).start();

Quarkus (RESTEasy):

@Path("/greet")
public class GreetingResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello, World!";
    }
}

Both frameworks offer concise ways to create web endpoints, but Helidon's approach is more focused on reactive programming, while Quarkus leverages JAX-RS annotations for a more traditional Java EE style.

20,301

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀

Pros of Graal

  • More versatile, supporting multiple languages beyond Java
  • Advanced JIT compilation and optimization techniques
  • Broader ecosystem with GraalVM Enterprise for enhanced performance

Cons of Graal

  • Steeper learning curve and more complex configuration
  • Longer build times for native images
  • Less focus on microservices and cloud-native development

Code Comparison

Quarkus (simplified REST endpoint):

@Path("/hello")
public class GreetingResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello from Quarkus";
    }
}

Graal (using Micronaut framework for comparison):

@Controller("/hello")
public class GreetingController {
    @Get(produces = MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello from GraalVM";
    }
}

Both examples showcase similar simplicity in creating REST endpoints, but Quarkus is more focused on microservices and cloud-native applications, while Graal provides a more general-purpose runtime environment.

19,604

JDK main-line development https://openjdk.org/projects/jdk

Pros of JDK

  • Comprehensive Java runtime and development kit
  • Widely adopted and supported across various platforms
  • Extensive documentation and community resources

Cons of JDK

  • Larger footprint and slower startup times
  • Not optimized for cloud-native or microservices architectures
  • Requires more configuration for modern application development

Code Comparison

JDK (Hello World example):

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

Quarkus (RESTful endpoint example):

@Path("/hello")
public class GreetingResource {
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello from RESTEasy Reactive";
    }
}

The JDK example shows a basic Java application, while the Quarkus example demonstrates a RESTful endpoint with minimal code. Quarkus leverages modern Java features and frameworks to simplify development and improve performance in cloud-native environments.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Quarkus Quarkus

Version GitHub Actions Status Commits License Project Chat Gitpod Ready-to-Code Supported JVM Versions Develocity GitHub Repo stars

Quarkus - Supersonic Subatomic Java

Quarkus is a Cloud Native, (Linux) Container First framework for writing Java applications.

  • Container First: Minimal footprint Java applications optimal for running in containers.
  • Cloud Native: Embraces 12 factor architecture in environments like Kubernetes.
  • Unify imperative and reactive: Brings under one programming model non-blocking and imperative styles of development.
  • Standards-based: Based on the standards and frameworks you love and use (RESTEasy and JAX-RS, Hibernate ORM and JPA, Netty, Eclipse Vert.x, Eclipse MicroProfile, Apache Camel...).
  • Microservice First: Brings lightning fast startup time and code turnaround to Java apps.
  • Developer Joy: Development centric experience without compromise to bring your amazing apps to life in no time.

All under ONE framework.

Getting Started

Migration Guides

We collect all the migration notes in our migration guides.

Release Planning

Interested in when the next release is coming? Check our release planning document for details.

How to build Quarkus

The build instructions are available in the contribution guide.