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.
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-rustRoute discovery, sending, persistence, replication and delivery: every hop of the RocketMQ model, implemented in async Rust.
The RocketMQ model you already know, rebuilt in a language that turns whole classes of runtime failures into compile errors.
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.
Built on Tokio. Networking, request processing and background services are non-blocking, with owned runtimes and orderly shutdown.
Implements the remoting protocol and the gRPC messaging API, so Rust and Java clients and servers interoperate at documented boundaries.
An append-only CommitLog with ConsumeQueue and index files, a RocksDB backend, and tiered storage for data beyond local disks.
Ordered, delayed, transactional, batch and request-reply messaging, consumed through Push, LitePull or POP.
A Raft-based Controller coordinates master election and in-sync replicas across Broker groups.
Authentication, ACL authorization and TLS guard client and administrative access.
Prometheus metrics plus OpenTelemetry traces and logs over OTLP, enabled through opt-in build features.
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(())}
Services, libraries and operations tooling evolve together in a single repository.
NameServer, Broker, Proxy and Controller: the deployable runtime of a RocketMQ cluster.
Client SDK, protocol, transport, storage engines, runtime and auth, each usable on its own from crates.io.
Admin CLI and TUI, web and desktop dashboards, MCP servers and AI SRE workflows.
Four steps stand up a local cluster from source and push your first messages through it.
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
The route registry for brokers and clients. It listens on 127.0.0.1:9876 by default.
cargo run --bin rocketmq-namesrv-rustGive 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
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
RocketMQ-Rust is developed in the open. Star the repository, join the discussion, or pick up a good first issue.
Browse good first issuesRocketMQ-Rust is an independent community project, not an official Apache Software Foundation release. Apache RocketMQ is a trademark of the Apache Software Foundation.