Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions frameworks/aegon-java/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM archlinux:latest AS build

RUN pacman -Syu --noconfirm --needed \
base-devel \
cmake \
ninja \
git \
liburing \
glaze \
openssl \
libdeflate \
sqlite \
postgresql-libs \
libngtcp2 \
libnghttp3 \
protobuf \
jdk-openjdk \
maven

ARG AEGON_REPO=https://github.com/UdayKhare09/Aegon.git
ARG AEGON_REF=main
ARG AEGON_COMMIT=5fe9629

WORKDIR /src
RUN echo "Building Aegon commit: ${AEGON_COMMIT}" && \
git clone --branch "${AEGON_REF}" "${AEGON_REPO}" aegon-src && \
cd aegon-src && \
git checkout "${AEGON_COMMIT}"

WORKDIR /src/aegon-src
RUN cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DAEGON_BUILD_TESTS=OFF \
-DAEGON_BUILD_SAMPLES=OFF \
-DAEGON_BUILD_BENCHMARKS=OFF \
-DAEGON_BUILD_C_ABI=ON \
-DAEGON_ENABLE_NATIVE_TUNING=ON \
-DCMAKE_INSTALL_PREFIX=/usr/local && \
cmake --build build -j$(nproc) && \
cmake --install build

WORKDIR /src/aegon-src/bindings/java
RUN mvn clean install -DskipTests

WORKDIR /app
COPY pom.xml ./
RUN mvn -q dependency:go-offline
COPY src ./src
RUN mvn -q package dependency:copy-dependencies -DskipTests

FROM archlinux:latest

RUN pacman -Syu --noconfirm --needed \
liburing \
openssl \
libdeflate \
sqlite \
postgresql-libs \
jemalloc \
libngtcp2 \
libnghttp3 \
protobuf \
jre-openjdk-headless && \
pacman -Scc --noconfirm

ENV LD_PRELOAD=/usr/lib/libjemalloc.so
ENV LD_LIBRARY_PATH=/usr/local/lib

COPY --from=build /usr/local/lib/ /usr/local/lib/
COPY --from=build /app/target/aegon-java-httparena.jar /app/aegon-java-httparena.jar
COPY --from=build /app/target/dependency /app/lib

EXPOSE 8080 8081 8082 8443 8443/udp

CMD ["java", \
"--enable-native-access=ALL-UNNAMED", \
"-XX:+UseParallelGC", \
"-Xms512m", "-Xmx2g", \
"-Djava.library.path=/usr/local/lib", \
"-cp", "/app/aegon-java-httparena.jar:/app/lib/*", \
"httparena.Main"]
50 changes: 50 additions & 0 deletions frameworks/aegon-java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# aegon-java

[Aegon Java](https://github.com/UdayKhare09/Aegon) provides high-performance Java 22+ Foreign Function & Memory (FFM / Project Panama) bindings for the Linux-native [Aegon](https://github.com/UdayKhare09/Aegon) asynchronous web framework.

It bridges low-overhead C++26 `io_uring` reactor primitives directly into modern Java without JNI glue overhead, combining kernel-level I/O rings with Project Loom Virtual Threads and SIMD-accelerated Fastjson2 serialization.

## Stack

- **Language:** Java 22+ (OpenJDK / Eclipse Temurin)
- **Engine:** Linux `io_uring` multishot accept/recv, provided buffer rings via Panama FFM
- **Concurrency:** Inline native reactor dispatch for synchronous routes; automated Project Loom Virtual Threads for asynchronous non-blocking routes
- **Serialization:** Fastjson2 (SIMD-accelerated JSON parsing and generation)
- **Compression:** `libdeflate` gzip/deflate streaming middleware
- **Crypto & TLS:** Linux kTLS TX offload with OpenSSL TLS 1.3 and ALPN (`h2`, `http/1.1`)
- **HTTP/3:** Native QUIC/UDP protocol support via `libngtcp2` and `libnghttp3`
- **WebSocket:** RFC 6455 full-duplex WebSocket echo
- **Build:** Maven on Arch Linux

## Endpoints

| Endpoint | Method | Protocol | Description |
|---|---|---|---|
| `/pipeline` | GET | HTTP/1.1 | Pipelined plaintext response (`ok`) |
| `/baseline11` | GET | HTTP/1.1 | Fast query string parameter summation |
| `/baseline11` | POST | HTTP/1.1 | Sums query parameters and request body |
| `/baseline2` | GET | HTTP/2 | Baseline query summation over HTTP/2 |
| `/baseline2` | POST | HTTP/2 | Baseline query + body summation over HTTP/2 |
| `/delay/:ms` | GET | HTTP/1.1 | Non-blocking asynchronous delay via Project Loom Virtual Threads |
| `/json/:count?m=N` | GET | HTTP/1.1 & HTTP/2 | Fastjson2 serialization with `libdeflate` compression |
| `/echo` | POST | TLS | 8Gbit verbatim binary stream echo |
| `/static/*` | GET | TLS, HTTP/2 & HTTP/3 | High-throughput static file delivery via `router.staticFiles` |
| `/ws` | Upgrade | HTTP/1.1 (RFC 6455) | Full-duplex WebSocket echo with native `io_uring` batching |

## Ports & Protocols

Aegon Java runs concurrent multi-port listeners with protocol multiplexing:

- **Port 8080 (HTTP/1.1 Plaintext & WebSocket):** Primary plaintext and WebSocket benchmark port (`baseline`, `async`, `latency-*`, `pipelined`, `limited-conn`, `echo-ws`, `echo-ws-pipeline`, `echo-ws-limited`).
- **Port 8082 (HTTP/2 Cleartext / Prior Knowledge):** `h2c` benchmarking (`baseline-h2c`, `json-h2c`).
- **Port 8081 (HTTP/1.1 TLS):** Secure HTTP/1.1 workloads (`json-tls`, `8gbit`, `static-tls`).
- **Port 8443 (HTTP/2 TLS & HTTP/3 QUIC / UDP):** Secure HTTP/2 and HTTP/3 workloads (`baseline-h2`, `static-h2`, `baseline-h3`, `static-h3`).

## Completeness & Features

Aegon Java qualifies for 4/4 Completeness (100%, multiplier ×1.00):
- **Routing:** Parameterized path matching (`:ms`, `:count`), static prefix tree matching (`/static/*`), and RFC 6455 WebSocket routes (`/ws`).
- **Middleware:** Composable request/response middleware chain with streaming compression (`useCompress`).
- **Request:** Zero-copy URI decoding, query parsing, header lookup, route params, and body handling.
- **Response:** Fluent response builder, custom status codes, headers, streaming, and direct Fastjson2 serialization.

43 changes: 43 additions & 0 deletions frameworks/aegon-java/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"display_name": "aegon-java",
"language": "Java",
"type": "experimental",
"mode": "standard",
"engine": "io_uring",
"completeness": {
"routing": true,
"middleware": true,
"request": true,
"response": true
},
"description": "Linux-native Java 22+ web framework powered by Aegon's io_uring multishot engine, Project Panama Foreign Function & Memory (FFM) API, Project Loom virtual threads, Fastjson2, and libdeflate compression.",
"repo": "https://github.com/UdayKhare09/Aegon",
"enabled": true,
"tests": [
"baseline",
"async",
"latency-1m",
"latency-10k",
"latency-500k-8cpu",
"pipelined",
"limited-conn",
"json-comp",
"json-tls",
"8gbit",
"static-tls",
"baseline-h2c",
"json-h2c",
"baseline-h2",
"static-h2",
"baseline-h3",
"static-h3",
"echo-ws",
"echo-ws-pipeline",
"echo-ws-limited"
],
"maintainers": [
"UdayKhare09",
"Surendra1341"
]
}

64 changes: 64 additions & 0 deletions frameworks/aegon-java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>httparena</groupId>
<artifactId>aegon-java-httparena</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.release>22</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<aegon.version>0.3.2</aegon.version>
<fastjson2.version>2.0.53</fastjson2.version>
</properties>

<dependencies>
<dependency>
<groupId>com.teamzemo</groupId>
<artifactId>aegon-java</artifactId>
<version>${aegon.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.fastjson2</groupId>
<artifactId>fastjson2</artifactId>
<version>${fastjson2.version}</version>
</dependency>
</dependencies>

<build>
<finalName>aegon-java-httparena</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>22</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/dependency</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Loading