Sandbox
@mxsm/rocketmq-rust

Rust RocketMQ services, clients, and tools

RocketMQ-Rust provides a Rust workspace for Apache RocketMQ compatibility, including message broker services, a NameServer, proxy layers, client SDKs, and shared protocol and storage crates. The repo is organized so you can run RocketMQ components, embed the client library, or use the admin and dashboard tools.

1,515 starsโ€ข256 forksโ€ขRustโ€ขUpdated 7d ago
Who it's for

Builders who want to run RocketMQ-compatible messaging or embed a Rust client SDK in their apps.

What it delivers

You can build and operate RocketMQ-compatible messaging in Rust, or add a Rust client to existing apps.

What it does

Broker and NameServer services

Implements `rocketmq-broker` and `rocketmq-namesrv` for routing, storage, delivery, and service discovery.

Rust client SDK

Provides async producer, consumer, and admin APIs in `rocketmq-client`.

Protocol and model crates

Includes `rocketmq-protocol`, `rocketmq-model`, and `rocketmq-transport` for RocketMQ wire compatibility and shared data types.

Storage and runtime crates

Adds `rocketmq-store`, `rocketmq-tieredstore`, and `rocketmq-runtime` for durable storage and async coordination.

Admin and dashboard tools

Ships `rocketmq-tools`, `rocketmq-admin-cli`, `rocketmq-admin-tui`, and dashboard projects for operating clusters.

MCP server for RocketMQ ops

Includes `rocketmq-ai/rocketmq-mcp` for Model Context Protocol access to RocketMQ diagnostics and administration.

How to get it

  1. 1Run
    git clone https://github.com/mxsm/rocketmq-rust.git
    cd rocketmq-rust
    cargo build --workspace
  2. 2Run
    cargo run --bin rocketmq-namesrv-rust
  3. 3The default NameServer endpoint is 127.0.0.1:9876. To bind explicitly
    cargo run --bin rocketmq-namesrv-rust -- --ip 127.0.0.1 --port 9876
  4. 4Linux/macOS
    export ROCKETMQ_HOME="$(pwd)/.rocketmq"
    mkdir -p "$ROCKETMQ_HOME/conf"
    cargo run --bin rocketmq-broker-rust -- -n 127.0.0.1:9876
  5. 5Windows 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:9876
  6. 6Start the consumer example first
    cargo run -p rocketmq-client-rust --example consumer

README

GitHub last commit Crates.io Docs.rs CI Website Deploy Website Check CodeCov GitHub contributors Crates.io License
GitHub repo size Static Badge Ask DeepWiki

mxsm%2Frocketmq-rust | Trendshift mxsm | Trendshift

RocketMQ-Rust

๐Ÿš€ A high-performance, reliable, and feature-rich unofficial Rust implementation of Apache RocketMQ, designed to bring enterprise-grade message middleware to the Rust ecosystem.

Overview Quick Start Documentation Components
Contributing Community


โœจ Overview

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.

๐ŸŽฏ Why RocketMQ-Rust?

  • ๐Ÿฆ€ Memory Safety: Built on Rust's ownership model, eliminating entire classes of bugs like null pointer dereferences, buffer overflows, and data races at compile time
  • โšก High Performance: Zero-cost abstractions and efficient async runtime deliver exceptional throughput with minimal resource overhead
  • ๐Ÿ”’ Thread Safety: Fearless concurrency enables safe parallel processing without the risk of race conditions
  • ๐ŸŒ Cross-Platform: First-class support for Linux, Windows, and macOS with native performance on each platform
  • ๐Ÿ”Œ Ecosystem Integration: Seamlessly integrates with the rich Rust ecosystem including Tokio, Serde, and other modern libraries
  • ๐Ÿ“ฆ Production Ready: Battle-tested architecture with comprehensive error handling and observability

๐Ÿ—๏ธ Architecture

RocketMQ-Rust Architecture

RocketMQ-Rust implements a distributed architecture with the following core components:

  • Name Server: Lightweight service discovery and routing coordination
  • Broker: Message storage and delivery engine with support for topics, queues, and consumer groups
  • Producer Client: High-performance message publishing with various sending modes
  • Consumer Client: Flexible message consumption with push and pull models
  • Store: Efficient local storage engine optimized for sequential writes
  • Controller: Advanced high availability and failover capabilities

๐Ÿ“š Documentation

๐Ÿš€ Quick Start

Prerequisites

  • Rust toolchain 1.95.0
  • A shell with cargo available
  • Separate terminals for the NameServer, Broker, and client examples

See the toolchain and dependency trust policy for the pinned toolchain, dependency admission rules, and local validation contract.

1. Build the Workspace

git clone https://github.com/mxsm/rocketmq-rust.git
cd rocketmq-rust
cargo build --workspace

If 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"

2. Start the NameServer

cargo run --bin rocketmq-namesrv-rust

The default NameServer endpoint is 127.0.0.1:9876. To bind explicitly:

cargo run --bin rocketmq-namesrv-rust -- --ip 127.0.0.1 --port 9876

3. Start the Broker

The 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:9876

Windows 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:9876

Use cargo run --bin rocketmq-broker-rust -- --help to inspect configuration flags such as --configFile, --namesrvAddr, and config printing options.

4. Send and Receive Messages

Start the consumer example first:

cargo run -p rocketmq-client-rust --example consumer

Then send messages from another terminal:

cargo run -p rocketmq-client-rust --example producer

The quickstart examples use 127.0.0.1:9876 and TopicTest by default. For more messaging patterns, see:

๐Ÿ“ฆ Components & Crates

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.

Core Runtime Services

CrateResponsibility
rocketmq-namesrvNameServer implementation for broker registration, topic routing, and service discovery.
rocketmq-brokerBroker implementation for message storage, dispatch, delivery, and consumer coordination.
rocketmq-controllerController service for broker coordination and high availability workflows.
rocketmq-proxyProxy layer for gateway-style client access and protocol integration.
rocketmq-proxy-coreStable proxy contracts, use cases, and ingress-independent models.
rocketmq-proxy-clusterCluster-mode proxy adapter with keyed execution and remote Broker access.
rocketmq-proxy-localLocal-mode proxy adapter.

Client, Protocol, and Shared Libraries

CrateResponsibility
rocketmq-clientAsync producer, consumer, and admin SDK for application integration.
rocketmq-protocolRocketMQ wire commands, headers, serialization, and compatibility contracts.
rocketmq-transportRuntime-owned network sessions and canonical per-session writers.
rocketmq-modelShared message, route, configuration, and domain models.
rocketmq-authAuthentication, authorization, ACL evaluation, and request context support.
rocketmq-security-apiRuntime-neutral authentication, authorization, signing, and maintenance contracts.
rocketmq-filterMessage filtering support, including tag and expression-based filtering.

Storage, Runtime, and Observability

CrateResponsibility
rocketmq-storeDurable local storage engine for commit logs, consume queues, and message indexes.
rocketmq-store-apiBackend-neutral append, read, lifecycle, replication, checkpoint, and health capabilities.
rocketmq-store-localLocal CommitLog, ConsumeQueue, Index, mapped-file, and recovery implementation.
rocketmq-store-rocksdbRocksDB-backed store implementation.
rocketmq-tieredstoreTiered storage abstractions for extending message data beyond local disks.
rocketmq-runtimeAsync runtime abstractions and runtime-friendly coordination utilities.
rocketmq-errorShared error types and result conventions across workspace crates.
rocketmq-macrosProcedural macros used by RocketMQ-Rust crates and examples.
rocketmq-observabilityMetrics 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.

Tools, Examples, and Dashboards

ProjectResponsibility
rocketmq-exampleStandalone examples covering producer, consumer, request/reply, ordering, delay, and transaction flows.
rocketmq-toolsCommand-line tools and operational utilities.
rocketmq-admin-cliCommand-line administration interface for cluster and broker operations.
rocketmq-admin-coreShared admin functionality used by CLI and terminal interfaces.
rocketmq-admin-tuiTerminal UI for interactive administration workflows.
rocketmq-store-inspectStorage inspection utilities for broker data files.
rocketmq-mcpModel Context Protocol server for deny-by-default RocketMQ diagnostics and administration.
rocketmq-dashboardDashboard workspace for desktop, web, and shared management UI components.
rocketmq-dashboard-commonShared dashboard models and reusable dashboard infrastructure.
rocketmq-dashboard-gpuiGPUI-based desktop dashboard.
rocketmq-dashboard-tauriTauri-based cross-platform dashboard shell and backend.
rocketmq-dashboard-webWeb dashboard frontend and backend project.

๐Ÿ’ก Capabilities

RocketMQ-Rust focuses on RocketMQ-compatible messaging services and Rust-native integration points.

AreaWhat it provides
Messaging servicesNameServer, Broker, Controller, and Proxy services for routing, storage, delivery, coordination, and gateway access.
Client integrationAsync producer, consumer, admin, request/reply, batch, ordered, delayed, and transactional messaging APIs.
Protocol compatibilityRocketMQ remoting command models, headers, serialization, route discovery, and client/broker interoperability.
Storage engineDurable commit log, consume queue, index, checkpoint, and tiered storage building blocks.
Security and governanceAuthentication, authorization, ACL evaluation, request context, and broker/client-side integration points.
OperationsMetrics, tracing, admin tools, storage inspection utilities, and dashboard projects for cluster visibility.

๐Ÿงช Build & Validation

Quick Start covers the first local run. For regular development and review, use the root workspace commands below.

TaskCommand
Build the workspacecargo build --workspace
Run workspace testscargo test --workspace
Run a focused crate testcargo test -p rocketmq-client
Format Rust codecargo fmt --all
Run clippy with workspace featurescargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings
Build local API documentationcargo doc --workspace --no-deps

Standalone projects under rocketmq-example/ and rocketmq-dashboard/ are validated from their own project roots.

๐Ÿค Contributing

We welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, your input is valuable.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Contribution Guidelines

  • Follow Rust best practices and idiomatic patterns
  • Add tests for new functionality
  • Update documentation as needed
  • Ensure CI passes before submitting PR
  • Use meaningful commit messages

For detailed guidelines, please read our Contribution Guide.

Repository Activity

Repository Activity

โ“ FAQ

Is RocketMQ-Rust production-ready?

The services are designed for production-oriented deployments, but production readiness is a property of a specific candidate and environment. Promotion requires commit- and digest-bound fault, soak, performance, acknowledgement RPO/RTO, and executable rollback evidence described by the production-readiness runbook.

Is it compatible with Apache RocketMQ?

Yes, RocketMQ-Rust implements the RocketMQ protocol and can interoperate with Apache RocketMQ Java clients and servers.

What's the minimum supported Rust version (MSRV)?

The minimum supported Rust version is stable Rust 1.95.0. The repository pins that exact toolchain for local and production builds; dated nightly toolchains are reserved for explicitly documented specialized checks such as Miri and rustdoc JSON generation.

How does performance compare to Java RocketMQ?

No general comparison is claimed. Component microbenchmarks detect algorithmic regressions; they do not establish production TPS. Candidate performance is accepted only from the target-hardware profile with identical configuration, at least five samples, dispersion checks, and a correctness-valid evidence bundle indexed by the architecture evidence document.

Can I use it with existing RocketMQ deployments?

Yes, you can deploy RocketMQ-Rust components alongside Java RocketMQ. For example, you can use Rust clients with Java brokers, or vice versa.

How can I migrate from Java RocketMQ to RocketMQ-Rust?

Migration can be done incrementally:

  1. Start by using Rust client SDK with existing Java brokers
  2. Gradually replace brokers with Rust implementation
  3. Both implementations can coexist during migration

Refer to our migration guide for detailed steps.

๐Ÿ‘ฅ Community & Support

Contributors

Thanks to all our contributors! ๐Ÿ™

๐Ÿ“„ License

RocketMQ-Rust is licensed under the Apache License 2.0.

See LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0.

๐Ÿ™ Acknowledgments

  • Apache RocketMQ Community for the original Java implementation and design
  • Rust Community for excellent tooling and libraries
  • All Contributors who have helped make this project better

Built with โค๏ธ by the RocketMQ-Rust community

Files in the repo

Repository payloadโ€ข57 top-level entries
  • .agents
  • .claude
  • .github
  • distribution
  • docker
  • fuzz
  • resources
  • rocketmq-ai
  • rocketmq-auth
  • rocketmq-broker
  • rocketmq-client
  • rocketmq-controller
  • rocketmq-dashboard
  • rocketmq-doc
  • rocketmq-error
  • rocketmq-example
  • rocketmq-filter
  • rocketmq-macros
  • rocketmq-model
  • rocketmq-namesrv
  • rocketmq-observability
  • rocketmq-protocol
  • rocketmq-proxy
  • rocketmq-proxy-cluster
  • rocketmq-proxy-core
  • rocketmq-proxy-local
  • rocketmq-runtime
  • rocketmq-security-api
  • rocketmq-store
  • rocketmq-store-api
  • rocketmq-store-local
  • rocketmq-store-rocksdb
  • rocketmq-tieredstore
  • rocketmq-tools
  • rocketmq-transport
  • rocketmq-website
  • scripts
  • .clippy.toml
  • .coderabbit.yaml
  • .dockerignore
  • .gitattributes
  • .gitignore
  • AGENTS.md
  • Cargo.lock
  • Cargo.toml
  • CHANGELOG.md
  • CLAUDE.md
  • CODE_OF_CONDUCT.md
  • codecov.yml
  • CONTRIBUTING.md
  • deny.toml
  • LICENSE-APACHE
  • NOTICE
  • README-zh_cn.md
  • README.md
  • rust-toolchain.toml
  • rustfmt.toml

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More frameworks & sdks

HKUDS/nanobotFrameworks & SDKs

Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps

48k
microsoft/
SkillOpt
microsoft/SkillOptFrameworks & SDKs

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

17k
omnigent-ai/omnigentFrameworks & SDKs

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents โ€” swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.

9.8k
kyegomez/
OpenMythos
kyegomez/OpenMythosFrameworks & SDKs

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

15k
D4Vinci/ScraplingFrameworks & SDKs

๐Ÿ•ท๏ธ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

80k