Rust proof of concept for OpenSearch 3.x extensions that run as a separate process instead of an in-process plugin.
The current implementation focuses on the REST-first extension lifecycle:
- transport frame parsing and encoding
- TCP and transport handshakes
- extension initialization
- REST route registration
- REST request dispatch for a hello-world extension
The design is intentionally closer to opensearch-sdk-py than the larger Java SDK surface.
This project uses Nix for managing development dependencies (Rust and JDK for local OpenSearch work).
- Nix package manager installed with flakes enabled
-
Enter the Nix development shell:
nix develop
-
Build the project:
cargo build
-
Run the server:
cargo run
-
Run tests:
cargo test -
Run the live OpenSearch 3.x hello-world harness:
./scripts/live_hello.sh
This builds the local
../OpenSearchno-jdk-linux-tararchive if needed, starts the Rust extension, initializes it through/_extensions/initialize, and verifies/_extensions/_hello-world-rs/hello. -
Run the cargo-visible ignored integration test for the same flow:
cargo test --test live_hello -- --ignored --nocaptureUse
OPENSEARCH_DIR=/path/to/OpenSearchif your local checkout is not at../OpenSearch.
This project includes a justfile for common development tasks:
just build # Build the project (with formatting)
just test # Run tests
just run # Run the server
just live_hello # Run the end-to-end OpenSearch 3.x hello-world harness
just test_live_hello # Run the ignored cargo integration test for the live harness
just fmt # Format code
just clippy # Run clippy lintsIf you prefer not to use Nix, ensure you have the following installed:
- Rust toolchain (rustc, cargo, rustfmt)
- JDK 17 (for running OpenSearch)
justcommand runner (optional)
internal:tcp/handshakeinternal:transport/handshakeinternal:discovery/extensionsinternal:extensions/restexecuteonextensiontaction- outbound
internal:discovery/registerrestactions - outbound
internal:discovery/enviornmentsettings
The sample binary exposes one route:
GET /hello
When registered through OpenSearch with the included examples/hello/hello.json, that route is expected to be reachable through:
/_extensions/_hello-world-rs/hello
The sample server accepts optional runtime overrides for live harnessing:
OPENSEARCH_SDK_RS_HOSTOPENSEARCH_SDK_RS_PORTOPENSEARCH_SDK_RS_TRACE