mxsm/rocketmq-rust

🚀 Apache RocketMQ built in Rust 🦀 — faster, safer, and more memory-efficient. Powering high-performance messaging for the AI era, with AI Agent, MCP, and AI-SRE capabilities.

RocketMQ-Rust: Apache RocketMQ, Rebuilt in Rust

What it is

RocketMQ-Rust is an unofficial, from-scratch Rust implementation of Apache RocketMQ — a popular open-source message broker (software that lets different applications exchange data reliably, often used for decoupling services, queuing tasks, or streaming events). It's not affiliated with the Apache Software Foundation, but it aims to be compatible with the original Java-based RocketMQ.

The project is currently at stable version 1.0.0, with all 28 workspace crates published on crates.io and 13 container images on Docker Hub and GHCR.

What it includes

A complete message system needs several moving parts. RocketMQ-Rust provides all of them:

  • NameServer — keeps track of which brokers are alive and where topics live
  • Broker — the core workhorse: stores messages, handles requests, manages metadata
  • Controller — handles leader election for high-availability setups
  • Proxy — lets clients connect via gRPC (a modern API protocol)
  • Client SDK — a Rust library for building producers (senders) and consumers (receivers)
  • Operations tooling — admin CLI, terminal UI, web/desktop dashboards, container images, Helm charts, Kubernetes manifests

A minimal cluster needs only a NameServer, a Broker, and a client — everything else is optional.

Why it's interesting

  • Memory safety without garbage collection — Rust's ownership model catches bugs like use-after-free and data races at compile time, with no GC pauses
  • Async by design — built on Tokio, with explicit runtime ownership, bounded queues, and graceful shutdown that reports what it stopped
  • RocketMQ compatible — speaks the same wire protocol as the original, serves the same gRPC API, and can even load existing Java Broker .properties config files (Apache RocketMQ 5.5.0 is the comparison baseline)
  • Pluggable storage — local files by default, with optional RocksDB and tiered storage backends
  • Secure and observable — ACL authentication, TLS transport, and OpenTelemetry metrics/traces/logs with OTLP and Prometheus exporters
  • AI-ready operations — a read-only MCP server for diagnostics, a separate deny-by-default MCP server for supervised changes, and an AI SRE platform
  • Cross-platform — CI-tested on Linux, Windows, and macOS

How to try it

You can run a single-node cluster from source. Prerequisites: Rust 1.95.0 (pinned in the repo), a C/C++ build toolchain, four free TCP ports (9876, 10909, 10911, 10912), and ~1.5 GB of disk for the broker's preallocated store files.

The quick start walks through four steps:

  1. Start the NameServer (cargo run -p rocketmq-namesrv ...)
  2. Start the Broker with a small TOML config
  3. Run the example producer (sends 10 messages to a topic)
  4. Run the example consumer (prints those messages)

You can also add the client SDK to your own Rust application via Cargo dependencies — the README shows a minimal producer example.

Current status

Stable 1.0.0 release. The README notes it's an independent community distribution, not an official Apache release. Documentation lives at rocketmqrust.com, with API docs on docs.rs and interactive AI-powered docs on DeepWiki.

Related

  • Project
  • Project
  • Project
  • Project
  • Project