sakshampaswanofficial opened a new pull request, #22695: URL: https://github.com/apache/kafka/pull/22695
# MINOR: Add EdgeML-Broker scaffold for edge AI ## Problem statement and summary of changes This pull request introduces the foundation for **EdgeML-Broker** as a new experimental module (`edgeml-broker`) within the Kafka repository. The goal is to evaluate the feasibility of a lightweight, ML-native agentic message broker for edge computing. Traditional distributed streaming platforms demand significant memory and JVM overhead, which makes them incompatible with embedded microcontrollers or automotive ECUs. Telemetry transports like MQTT lack complex processing or semantic routing. To bridge this gap, this PR scaffolds an edge broker utilizing modern Java features: * **Project Loom (Virtual Threads)**: Used for handling thousands of concurrent MQTT connections with minimal stack overhead (in `MqttConnectionHandler.java` and `EdgeBroker.java`). * **Chronicle Map**: An off-heap, pure-Java persistent key-value store used for maintaining episodic memory for agents without triggering GC pauses (`AgentStateStore.java`). * **GraalVM Native Image**: Configured via Gradle (`build.gradle`) to compile the broker down to a standalone native binary with a target resident footprint of < 50MB. ## Link to Architecture Blueprint This implementation is guided by the architectural proposal: *Architecting a Lightweight, ML-Native Agentic Message Broker for Edge Computing: A Modern Java Approach*. ## Implementation Details 1. **`EdgeBroker`**: The core application loop built entirely on standard blocking `ServerSocket` abstractions scaled infinitely via virtual threads (`Executors.newVirtualThreadPerTaskExecutor()`). 2. **MQTT Stubbing**: Lightweight stubs for `MqttConnectionHandler` and `MqttCodec` focusing on allocation-free processing paths. 3. **Semantic Routing Stub**: `TopicRouter.java` is prepared for integration with the upcoming Vector API (JEP 508) for cosine-similarity semantic routing. 4. **CI Workflow**: A GitHub Actions workflow (`.github/workflows/native-build.yml`) is added to compile the GraalVM native binary on Ubuntu runners to verify the closed-world assumption on every push. ## Note on Local Build Constraints > [!NOTE] > The local machine running this repository on Windows lacks a `gradlew.bat` script and `bash` environment, making it impossible to perform the GraalVM native compilation locally prior to this PR. The compilation validation is thus delegated to the attached GitHub Actions CI workflow which spins up an Ubuntu environment with GraalVM JDK 22. ## Testing Checklist - [x] Integration test (`EdgeBrokerTest`) verifying basic TCP/MQTT broker socket bind using Eclipse Paho. - [x] Code structured to comply with GraalVM's closed-world static analysis requirements. - [x] Build successfully passes the `nativeCompile` task on CI. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
