Apache RocketMQ build in Rust. Faster, safer, and with lower memory usage. ⭐ Star to support our work❤️!
Apache RocketMQ build in Rust. Faster, safer, and with lower memory usage. ⭐ Star to support our work❤️!
A high-performance, reliable, and feature-rich unofficial Rust implementation of Apache RocketMQ, designed to bring enterprise-grade message middleware to the Rust ecosystem.
RocketMQ-Rust is a complete reimplementation of Apache RocketMQ in Rust, leveraging Rust's unique advantages in memory safety, zero-cost abstractions, and fearless concurrency. This project aims to provide Rust developers with a production-ready distributed message queue system that delivers exceptional performance while maintaining full compatibility with the RocketMQ protocol.
RocketMQ-Rust implements a distributed architecture with the following core components:
cargo availableSee the toolchain and dependency trust policy for the pinned toolchain, dependency admission rules, and local validation contract.
git clone https://github.com/mxsm/rocketmq-rust.git
cd rocketmq-rust
cargo build --workspaceIf you only want to use the client SDK from your own application, add the current release to Cargo.toml:
[dependencies]
rocketmq-client-rust = "1.0.0"
rocketmq-model = "1.0.0"
rocketmq-protocol = "1.0.0"cargo run --bin rocketmq-namesrv-rustThe default NameServer endpoint is 127.0.0.1:9876. To bind explicitly:
cargo run --bin rocketmq-namesrv-rust -- --ip 127.0.0.1 --port 9876The Broker requires ROCKETMQ_HOME. Point it at an existing RocketMQ home or create a local runtime directory for quick testing.
Linux/macOS:
export ROCKETMQ_HOME="$(pwd)/.rocketmq"
mkdir -p "$ROCKETMQ_HOME/conf"
cargo run --bin rocketmq-broker-rust -- -n 127.0.0.1:9876Windows PowerShell:
$env:ROCKETMQ_HOME = "$PWD\.rocketmq"
New-Item -ItemType Directory -Force "$env:ROCKETMQ_HOME\conf" | Out-Null
cargo run --bin rocketmq-broker-rust -- -n 127.0.0.1:9876Use cargo run --bin rocketmq-broker-rust -- --help to inspect configuration flags such as --configFile, --namesrvAddr, and config printing options.
Start the consumer example first:
cargo run -p rocketmq-client-rust --example consumerThen send messages from another terminal:
cargo run -p rocketmq-client-rust --example producerThe quickstart examples use 127.0.0.1:9876 and TopicTest by default. For more messaging patterns, see:
RocketMQ-Rust is organized into deployable services, reusable protocol/runtime crates, and operational applications. The tables below focus on responsibility and integration boundaries instead of per-crate maturity labels.
| Crate | Responsibility |
|---|---|
| rocketmq-namesrv | NameServer implementation for broker registration, topic routing, and service discovery. |
| rocketmq-broker | Broker implementation for message storage, dispatch, delivery, and consumer coordination. |
| rocketmq-controller | Controller service for broker coordination and high availability workflows. |
| rocketmq-proxy | Proxy layer for gateway-style client access and protocol integration. |
| rocketmq-proxy-core | Stable proxy contracts, use cases, and ingress-independent models. |
| rocketmq-proxy-cluster | Cluster-mode proxy adapter with keyed execution and remote Broker access. |
| rocketmq-proxy-local | Local-mode proxy adapter. |
| Crate | Responsibility |
|---|---|
| rocketmq-client | Async producer, consumer, and admin SDK for application integration. |
| rocketmq-protocol | RocketMQ wire commands, headers, serialization, and compatibility contracts. |
| rocketmq-transport | Runtime-owned network sessions and canonical per-session writers. |
| rocketmq-model | Shared message, route, configuration, and domain models. |
| rocketmq-auth | Authentication, authorization, ACL evaluation, and request context support. |
| rocketmq-security-api | Runtime-neutral authentication, authorization, signing, and maintenance contracts. |
| rocketmq-filter | Message filtering support, including tag and expression-based filtering. |
| Crate | Responsibility |
|---|---|
| rocketmq-store | Durable local storage engine for commit logs, consume queues, and message indexes. |
| rocketmq-store-api | Backend-neutral append, read, lifecycle, replication, checkpoint, and health capabilities. |
| rocketmq-store-local | Local CommitLog, ConsumeQueue, Index, mapped-file, and recovery implementation. |
| rocketmq-store-rocksdb | RocksDB-backed store implementation. |
| rocketmq-tieredstore | Tiered storage abstractions for extending message data beyond local disks. |
| rocketmq-runtime | Async runtime abstractions and runtime-friendly coordination utilities. |
| rocketmq-error | Shared error types and result conventions across workspace crates. |
| rocketmq-macros | Procedural macros used by RocketMQ-Rust crates and examples. |
| rocketmq-observability | Metrics and tracing integration for service and client instrumentation. |
The cross-cutting ownership, cancellation, error, limit, compatibility, and failure-mode contracts are documented in the core capability contracts.
| Project | Responsibility |
|---|---|
| rocketmq-example | Standalone examples covering producer, consumer, request/reply, ordering, delay, and transaction flows. |
| rocketmq-tools | Command-line tools and operational utilities. |
| rocketmq-admin-cli | Command-line administration interface for cluster and broker operations. |
| rocketmq-admin-core | Shared admin functionality used by CLI and terminal interfaces. |
| rocketmq-admin-tui | Terminal UI for interactive administration workflows. |
| rocketmq-store-inspect | Storage inspection utilities for broker data files. |
| rocketmq-mcp | Model Context Protocol server for deny-by-default RocketMQ diagnostics and administration. |
| rocketmq-dashboard | Dashboard workspace for desktop, web, and shared management UI components. |
| rocketmq-dashboard-common | Shared dashboard models and reusable dashboard infrastructure. |
| rocketmq-dashboard-gpui | GPUI-based desktop dashboard. |
| rocketmq-dashboard-tauri | Tauri-based cross-platform dashboard shell and backend. |
| rocketmq-dashboard-web | Web dashboard frontend and backend project. |
RocketMQ-Rust focuses on RocketMQ-compatible messaging services and Rust-native integration points.
| Area | What it provides |
|---|---|
| Messaging services | NameServer, Broker, Controller, and Proxy services for routing, storage, delivery, coordination, and gateway access. |
| Client integration | Async producer, consumer, admin, request/reply, batch, ordered, delayed, and transactional messaging APIs. |
| Protocol compatibility | RocketMQ remoting command models, headers, serialization, route discovery, and client/broker interoperability. |
| Storage engine | Durable commit log, consume queue, index, checkpoint, and tiered storage building blocks. |
| Security and governance | Authentication, authorization, ACL evaluation, request context, and broker/client-side integration points. |
| Operations | Metrics, tracing, admin tools, storage inspection utilities, and dashboard projects for cluster visibility. |
Quick Start covers the first local run. For regular development and review, use the root workspace commands below.
| Task | Command |
|---|---|
| Build the workspace | cargo build --workspace |
| Run workspace tests | cargo test --workspace |
| Run a focused crate test | cargo test -p rocketmq-client |
| Format Rust code | cargo fmt --all |
| Run clippy with workspace features | cargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings |
| Build local API documentation | cargo doc --workspace --no-deps |
Standalone projects under rocketmq-example/ and rocketmq-dashboard/ are validated from their own project roots.
We welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, yo
No open issues yet, or sync has not completed.