Skip to main content
v1.0.0 is live on crates.ioRelease notes

Distributed messaging, forged in Rust.

RocketMQ-Rust is a community-built Rust implementation of Apache RocketMQ: NameServer, Broker, Proxy, Controller and async clients — memory-safe, non-blocking, and speaking the RocketMQ remoting and gRPC protocols.

Built for messages that are ordered, delayed, transactional, batched, request-reply

cargo add rocketmq-client-rust
Scroll to explore
  • Ordered messages
  • Delayed delivery
  • Transactional messages
  • Batch sending
  • Request-reply
  • Push consumer
  • LitePull consumer
  • POP consumption
  • Tag and SQL92 filtering
  • ACL authorization
  • TLS transport
  • Raft controller
  • gRPC proxy
  • Tiered storage
  • Tokio
  • Tonic gRPC
  • OpenRaft
  • RocksDB
  • OpenTelemetry
  • Prometheus
  • Rustls
  • Serde
  • Ratatui
  • Linux
  • macOS
  • Windows
  • Docker
  • Kubernetes
  • crates.io
Architecture in motion

Follow a message from producer to consumer

Route discovery, sending, persistence, replication and delivery: every hop of the RocketMQ model, implemented in async Rust.

BROKER GROUPNameServerroute registry · :9876Producerasync Rust clientbatch · ordered · txnConsumerconsumer groupPush · LitePull · POPControllerRaft quorumProxygRPC ingress · :8081cluster · local modeBroker:10911 · remotingMASTERCommitLogConsumeQueueBrokerHA replicaSLAVECommitLog
  • Control plane
  • Produce
  • Store and replicate
  • Consume
Why RocketMQ-Rust

Engineered for the hot path

The RocketMQ model you already know, rebuilt in a language that turns whole classes of runtime failures into compile errors.

Memory safety without a garbage collector

Ownership and borrowing rule out data races and use-after-free at compile time. With no GC, there are no stop-the-world pauses on the message path.

Async from socket to disk

Built on Tokio. Networking, request processing and background services are non-blocking, with owned runtimes and orderly shutdown.

Speaks RocketMQ

Implements the remoting protocol and the gRPC messaging API, so Rust and Java clients and servers interoperate at documented boundaries.

Pluggable storage engines

An append-only CommitLog with ConsumeQueue and index files, a RocksDB backend, and tiered storage for data beyond local disks.

Every messaging pattern

Ordered, delayed, transactional, batch and request-reply messaging, consumed through Push, LitePull or POP.

High availability with Raft

A Raft-based Controller coordinates master election and in-sync replicas across Broker groups.

Security built in

Authentication, ACL authorization and TLS guard client and administrative access.

Observable by design

Prometheus metrics plus OpenTelemetry traces and logs over OTLP, enabled through opt-in build features.

Developer experience

An API that feels like Rust

Builders, typed results and explicit lifecycles. No hidden threads, no surprises.

use std::error::Error;use std::sync::Arc;
use rocketmq_client_rust::{ClientRuntime, DefaultMQProducer};use rocketmq_model::common::message::message_single::Message;
async fn produce(client: Arc<ClientRuntime>) -> Result<(), Box<dyn Error>> {    let mut producer = DefaultMQProducer::builder(client)        .producer_group("order_producer")        .name_server_addr("127.0.0.1:9876")        .build();    producer.start().await?;
    let message = Message::builder()        .topic("OrderTopic")        .tags("created")        .body("order-1024")        .build()?;
    if let Some(sent) = producer.send_with_timeout(message, 3_000).await? {        println!("{} at offset {}", sent.send_status, sent.queue_offset);    }
    producer.shutdown().await;    Ok(())}
Ecosystem

One workspace, a whole messaging platform

Services, libraries and operations tooling evolve together in a single repository.

  • Core services

    NameServer, Broker, Proxy and Controller: the deployable runtime of a RocketMQ cluster.

    • NameServer
    • Broker
    • Proxy
    • Controller
    Architecture overview
  • Reusable crates

    Client SDK, protocol, transport, storage engines, runtime and auth, each usable on its own from crates.io.

    • Client
    • Protocol
    • Transport
    • Model
    • Store
    • Runtime
    • Auth
    • Filter
    • Observability
    Module map
  • Operations and AI

    Admin CLI and TUI, web and desktop dashboards, MCP servers and AI SRE workflows.

    • Admin CLI
    • Admin TUI
    • Store Inspect
    • Web Dashboard
    • GPUI Dashboard
    • Tauri Dashboard
    • MCP
    • MCP Control
    • AI SRE
    Ecosystem guide
Quick start

From clone to first message

Four steps stand up a local cluster from source and push your first messages through it.

  1. Clone and build

    Fetch the workspace and build it with the pinned Rust 1.95 toolchain.

    git clone https://github.com/mxsm/rocketmq-rust.gitcd rocketmq-rustcargo build --workspace
  2. Start the NameServer

    The route registry for brokers and clients. It listens on 127.0.0.1:9876 by default.

    cargo run --bin rocketmq-namesrv-rust
  3. Start a Broker

    Give the Broker a home directory for its store and point it at the NameServer.

    export ROCKETMQ_HOME="$(pwd)/.rocketmq"mkdir -p "$ROCKETMQ_HOME/conf"cargo run --bin rocketmq-broker-rust -- -n 127.0.0.1:9876
  4. Send and consume

    Start the consumer first, then run the producer from a second terminal.

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

Build the next generation of messaging with us

RocketMQ-Rust is developed in the open. Star the repository, join the discussion, or pick up a good first issue.

Browse good first issues

RocketMQ-Rust is an independent community project, not an official Apache Software Foundation release. Apache RocketMQ is a trademark of the Apache Software Foundation.