Helidon Documentation

repository·main·Indexed 26 days ago

https://github.com/helidon-io/helidon

A collection of Java libraries for building microservices, leveraging Java 21 Virtual Threads for a thread-per-request programming model with reactive-level throughput. Includes documentation on Helidon Builder for code generation using blueprints and prototypes, archetype build and test processes, and API stability levels (Stable, Preview, Incubating, Internal).

Tokens
134.2K
Snippets
292
Records
790
Agent score
87%

What's inside Helidon

  1. Overview of Helidon Discovery

    main
    Helidon Discovery provides support for acquiring transient resources, such as URIs in a microservices environment, that correspond to a specific discovery name. The API and specification are designed to abstract away specific vendor implementations and underlying discovery mechanisms.
  2. Overview of Helidon Declarative Code Generation

    main
    The declarative/codegen module is the central location for all code generation logic specific to Helidon Declarative. Unlike standard production modules that follow a flat package structure, this module utilizes multiple packages to separate the code generation logic for different Helidon features. This design is possible because the module does not introduce significant implementation dependencies.
  3. Overview of Helidon Microservices

    main

    Helidon is a set of Java libraries designed for writing microservices.

    Key features of Helidon 4 include:

    • Níma WebServer: A high-performance web server built from the ground up for Java 21 Virtual Threads.
    • Thread-per-request style: Provides high throughput (similar to reactive servers) while maintaining the simplicity of blocking, thread-per-request programming.
    • Simplified SE API: In Helidon 4, the Helidon SE API has transitioned from asynchronous to blocking to leverage virtual threads, making code easier to write, maintain, and debug.
  4. Overview of Helidon DB Client

    main

    The Helidon DB Client provides a unified API for data access and querying. It acts as a layer above JDBC or the MongoDB Java Driver, allowing support for any relational database with a JDBC driver or MongoDB.

    Key features include:

    • Unified API: Consistent interface for different database types.
    • Observability: Built-in support for health checks, metrics, and tracing.
    • Portability: By defining native database statements in configuration files rather than hardcoding them, you can switch between different relational database drivers by only changing the configuration.
  5. Overview of Helidon Declarative

    main

    Helidon Declarative is a declarative programming model for Helidon SE. It allows developers to declare intention by annotating elements, reducing the amount of manual programming required for common microservice tasks.

    Key principles:

    • Uses a "nested" annotation approach (e.g., @Http.Path).
    • Relies on code generation instead of reflection to minimize runtime overhead and lookups.
    • All features are configured through the service registry.
    • Features are organized into namespace classes (e.g., Http, Ft for Fault Tolerance, Secured for Security).
  6. Overview of Helidon OpenAPI Generators

    main

    Helidon provides two specialized generators via the OpenAPI Generator tool to create code that integrates smoothly with Helidon applications:

    • Helidon Client Generator (java-helidon-client): Creates a Helidon SE client based on Helidon WebClients. It provides an abstraction similar to Remote Procedure Calls (RPC), allowing you to call remote service endpoints by invoking local methods with POJO business objects or Java types.
    • Helidon Server Generator (java-helidon-server): Creates server endpoint stubs. You implement the business logic by extending a generated class or implementing a generated interface, reducing the need for resource boilerplate.

    For Helidon SE, use the se library with each generator.

  7. Overview of Helidon Security features

    main

    Helidon Security provides the following core capabilities:

    • Authentication: Authenticates incoming requests and creates a security Subject containing a Principal (representing the user or service) and Grants (representing roles or scopes). Supported default principals include UserPrincipal and ServicePrincipal.
    • Authorization: Supports Attribute-Based Access Control (ABAC) and Role-Based Access Control (RBAC). RBAC can be implemented using the @RolesAllowed annotation in supported integrations.
    • Outbound Security: Propagates identity or secures outbound requests via the OutboundSecurityProvider SPI.
    • Audit: Audits security events (authentication, authorization, outbound) through the AuditProvider SPI. By default, it logs to a Java Util Logging (JUL) logger named AUDIT.
  8. Overview of Concurrency Limits in Helidon

    main

    The concurrency-limits module allows you to restrict the number of concurrent, in-progress operations (e.g., within a WebServer). Helidon provides three primary implementation types that can be selected via configuration:

    • fixed: A semaphore-based limit that supports queuing.
    • aimd: An Additive-Increase/Multiplicative-Decrease limit based on TCP congestion control algorithms, providing variable concurrency limits between a fixed minimum and maximum.
    • throughput: A rate-based limit that throttles requests to a specific amount over a defined duration, also supporting queuing.
  9. Overview of Helidon Data Codegen

    main

    Helidon Data Codegen provides a framework for generating repository and persistence-related code. It is divided into two main functional areas:

    1. Common Codegen: Contains the foundational logic for code generation, including base generators for persistence, repositories, and repository interfaces, as well as blueprints for method parameters and repository information.
    2. Helidon Data Codegen: Provides specialized generators for Helidon Data, including CRUD repository interfaces, JPQL query methods, and name-based query methods.
  10. Overview of Helidon Codegen environments

    main

    Helidon uses three primary environments for code processing and generation:

    1. Annotation processors: Preferred method for source code generation and processing.
    2. Classpath scanning: Used for analyzing external libraries or arbitrary code (e.g., via Maven plugins or CLI tools).
    3. Reflection: Limited to specific modules intentionally designed for reflection, such as the Config object mapping module.

    Helidon prioritizes annotation processing and source code generation whenever possible.

  11. Overview of Helidon SE Components

    main

    Helidon SE is a foundational set of APIs for microservices. As of Helidon 4, it leverages Java 21 virtual threads, allowing APIs to transition from asynchronous to a blocking programming model. This enables developers to perform blocking operations in a simple synchronous way without starving platform threads.

    Key components include:

    • WebServer: A programmatic HTTP API designed for high concurrency using virtual threads.
    • WebClient: An HTTP client for handling responses to HTTP requests.
    • Config: A flexible configuration framework supporting multiple sources and formats.
    • Security: A tool-chain for authentication, authorization, and context propagation.
    • DB Client: A unified API for database interactions.
    • gRPC: Support for building gRPC servers and clients.
    • GraphQL: Support for building GraphQL servers.
    • WebSocket: Support for WebSocket interactions as both server and client.
    • Observability: Includes Metrics for instrumentation, Tracing for profiling across services, and Health Checks for exposing application status.
    • Other features: CORS support, JSON Schema creation, Reactive Streams APIs, OpenAPI support, and Dependency Injection.