Convert Figma logo to code with AI

helidon-io logohelidon

Java libraries for writing microservices

3,481
562
3,481
508

Top Related Projects

20,197

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

Micronaut Application Framework

13,537

Quarkus: Supersonic Subatomic Java.

Spring Boot

14,240

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

Quick Overview

Helidon is a collection of Java libraries for building microservices-based applications. It offers two programming models: Helidon SE (a functional style) and Helidon MP (an implementation of Eclipse MicroProfile). Helidon provides a simple yet powerful framework for creating cloud-native Java applications.

Pros

  • Lightweight and fast, with minimal overhead and quick startup times
  • Supports both reactive (Helidon SE) and imperative (Helidon MP) programming models
  • Excellent integration with Kubernetes and cloud-native environments
  • Comprehensive set of features including security, health checks, metrics, and tracing

Cons

  • Relatively newer project compared to more established frameworks like Spring Boot
  • Smaller community and ecosystem compared to some alternatives
  • Learning curve for developers not familiar with reactive programming (for Helidon SE)
  • Documentation can be improved in some areas

Code Examples

  1. Creating a simple Helidon SE web server:
import io.helidon.webserver.Routing;
import io.helidon.webserver.WebServer;

public class Main {
    public static void main(String[] args) {
        WebServer.create(Routing.builder()
                .get("/hello", (req, res) -> res.send("Hello, World!"))
                .build())
            .start()
            .thenAccept(ws -> System.out.println("Server started at: http://localhost:" + ws.port()));
    }
}
  1. Implementing a REST endpoint with Helidon MP:
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/greet")
@RequestScoped
public class GreetResource {
    @GET
    public String getGreeting() {
        return "Hello, World!";
    }
}
  1. Configuring security with Helidon SE:
import io.helidon.security.Security;
import io.helidon.security.integration.webserver.WebSecurity;
import io.helidon.webserver.Routing;

Security security = Security.create(config);
Routing.builder()
    .register(WebSecurity.create(security))
    .get("/protected", WebSecurity.authenticate())
    .build();

Getting Started

To start with Helidon, add the following dependency to your Maven pom.xml:

<dependency>
    <groupId>io.helidon.microprofile.bundles</groupId>
    <artifactId>helidon-microprofile</artifactId>
    <version>2.5.1</version>
</dependency>

Create a simple application class:

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Application;

@Path("/hello")
public class HelloWorld extends Application {
    @GET
    public String sayHello() {
        return "Hello, Helidon!";
    }
}

Run the application using:

mvn package
java -jar target/your-app.jar

Competitor Comparisons

20,197

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

Pros of Graal

  • Offers advanced JIT compilation and ahead-of-time compilation capabilities
  • Supports multiple programming languages through Truffle framework
  • Provides significant performance improvements for Java applications

Cons of Graal

  • Steeper learning curve and more complex setup compared to Helidon
  • May have compatibility issues with some existing Java libraries
  • Requires more resources for development and deployment

Code Comparison

Helidon (Reactive WebServer):

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

Graal (Native Image):

@CEntryPoint(name = "main")
static void main(IsolateThread thread, int argc, CCharPointer argv) {
    System.out.println("Hello World!");
}

Summary

Graal is a high-performance JVM and JIT compiler with polyglot capabilities, while Helidon is a lightweight microservices framework. Graal excels in performance optimization and language support, but has a steeper learning curve. Helidon offers simpler development for microservices but may not provide the same level of performance optimization. The choice between them depends on project requirements, performance needs, and development team expertise.

Micronaut Application Framework

Pros of Micronaut

  • Faster startup time and lower memory footprint due to compile-time dependency injection
  • Extensive support for cloud-native features and microservices architecture
  • Rich ecosystem with numerous modules and integrations

Cons of Micronaut

  • Steeper learning curve, especially for developers new to AOT compilation concepts
  • Less mature compared to Helidon, which is backed by Oracle

Code Comparison

Micronaut:

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

Helidon:

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

Both frameworks offer similar syntax for creating RESTful endpoints, but Micronaut uses its own annotations while Helidon leverages JAX-RS annotations. Micronaut's approach aligns with its focus on compile-time processing, while Helidon's use of standard Java EE annotations may be more familiar to some developers.

13,537

Quarkus: Supersonic Subatomic Java.

Pros of Quarkus

  • Faster startup time and lower memory footprint due to its container-first approach
  • Extensive support for GraalVM native compilation, enhancing performance
  • Broader ecosystem with more extensions and integrations available

Cons of Quarkus

  • Steeper learning curve, especially for developers new to reactive programming
  • Less flexibility in terms of customization compared to Helidon's modular approach
  • Larger community and more frequent updates may lead to faster deprecation of features

Code Comparison

Helidon:

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

Quarkus:

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

In this basic example, both frameworks use similar JAX-RS annotations for creating RESTful endpoints. However, Quarkus often requires less boilerplate code for more complex scenarios and offers additional features like live coding and unified configuration.

Spring Boot

Pros of Spring Boot

  • Extensive ecosystem with a wide range of starter dependencies
  • Large and active community, providing robust support and resources
  • Mature framework with proven track record in enterprise applications

Cons of Spring Boot

  • Can be heavyweight for smaller applications or microservices
  • Steeper learning curve for beginners due to its comprehensive feature set

Code Comparison

Spring Boot:

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

Helidon:

public class Main {
    public static void main(String[] args) {
        Server server = Server.create().start();
        System.out.println("Server started at: http://localhost:" + server.port());
    }
}

Spring Boot offers a more opinionated and convention-based approach, while Helidon provides a lightweight and flexible foundation for building microservices. Spring Boot's annotations and auto-configuration simplify development, whereas Helidon's approach gives developers more control over the application structure.

Both frameworks support reactive programming and microservices architecture, but Spring Boot's extensive ecosystem and mature tooling give it an edge for larger, more complex applications. Helidon, being lighter and more focused on microservices, may be preferable for smaller, more targeted projects or when working within the Oracle ecosystem.

14,240

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

Pros of Vert.x

  • More mature and established project with a larger community
  • Highly flexible and modular architecture
  • Supports multiple programming languages (polyglot)

Cons of Vert.x

  • Steeper learning curve due to its flexibility
  • Less opinionated, requiring more configuration and setup

Code Comparison

Vert.x:

Vertx vertx = Vertx.vertx();
vertx.createHttpServer().requestHandler(req -> {
  req.response().end("Hello from Vert.x!");
}).listen(8080);

Helidon:

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

Both frameworks offer reactive programming models, but Vert.x provides a more low-level API, giving developers more control over the application's behavior. Helidon, on the other hand, offers a more streamlined approach with built-in support for microservices architecture and configuration management.

Vert.x excels in scenarios requiring high concurrency and scalability, while Helidon is better suited for rapid development of cloud-native microservices, especially when working within the Oracle ecosystem.

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

latest version latest version follow on Twitter

Helidon: Java Libraries for Microservices

Project Helidon is a set of Java Libraries for writing microservices. Helidon supports two programming models:

In either case your application is a Java SE program running on the new Helidon Níma WebServer that has been written from the ground up to use Java 21 Virtual Threads. With Helidon 4 you get the high throughput of a reactive server with the simplicity of thread-per-request style programming.

The Helidon SE API in Helidon 4 has changed significantly from Helidon 3. The use of virtual threads has enabled these APIs to change from asynchronous to blocking. This results in much simpler code that is easier to write, maintain, debug and understand. Earlier Helidon SE code will require modification to run on these new APIs. For more information see the Helidon SE Upgrade Guide.

Helidon 4 supports MicroProfile 6. This means your existing Helidon MP 3.x applications will run on Helidon 4 with only minor modifications. And since Helidon’s MicroProfile server is based on the new Níma WebServer you get all the benefits of running on virtual threads. For more information see the Helidon MP Upgrade Guide.

New to Helidon? Then jump in and get started.

Java 21 is required to use Helidon 4.

License

Helidon is available under Apache License 2.0.

Documentation

Latest documentation and javadocs are available at https://helidon.io/docs/latest.

Helidon White Paper is available here.

Get Started

See Getting Started at https://helidon.io.

Downloads / Accessing Binaries

There are no Helidon downloads. Just use our Maven releases (GroupID io.helidon). See Getting Started at https://helidon.io.

Helidon CLI

macOS:

curl -O https://helidon.io/cli/latest/darwin/helidon
chmod +x ./helidon
sudo mv ./helidon /usr/local/bin/

Linux:

curl -O https://helidon.io/cli/latest/linux/helidon
chmod +x ./helidon
sudo mv ./helidon /usr/local/bin/

Windows:

PowerShell -Command Invoke-WebRequest -Uri "https://helidon.io/cli/latest/windows/helidon.exe" -OutFile "C:\Windows\system32\helidon.exe"

See this document for more info.

Build

You need JDK 21 to build Helidon 4.

You also need Maven. We recommend 3.8.0 or newer.

Full build

$ mvn install

Checkstyle

# cd to the component you want to check
$ mvn validate  -Pcheckstyle

Copyright

# cd to the component you want to check
$ mvn validate  -Pcopyright

Spotbugs

# cd to the component you want to check
$ mvn verify  -Pspotbugs

Documentation

# At the root of the project
$ mvn site

Build Scripts

Build scripts are located in etc/scripts. These are primarily used by our pipeline, but a couple are handy to use on your desktop to verify your changes.

  • copyright.sh: Run a full copyright check
  • checkstyle.sh: Run a full style check

Get Help

Get Involved

Stay Informed