rustzmq2
A native async Rust implementation of ZeroMQ.
Send and receive messages across processes, machines, and languages using ZeroMQ — in pure async Rust, with no libzmq or libsodium dependency. Runs on tokio or smol; supports the full ZMTP security stack (PLAIN, CURVE, ZAP). Performance is on par with libzmq, with a meaningful edge on high-fanout PUB/XPUB workloads — see the live head-to-head comparison (or docs/BENCHMARKS.md for methodology).
Quick start
[]
= "0.1"
= { = "1", = ["full"] }
// server
use *;
async
// client
use *;
async
See examples/ for pub/sub, security (PLAIN, CURVE, ZAP), and more.
Platforms
| OS | Tested in CI | Notes |
|---|---|---|
| Linux (glibc, musl) | ubuntu-latest tests (x86_64); cross-compile checks for aarch64-musl, riscv64-musl |
tokio and smol runtimes; TCP + IPC + inproc |
| macOS | macos-latest tests |
tokio and smol runtimes; TCP + IPC + inproc |
| Windows | windows-latest tests |
tokio runtime only; TCP + inproc (IPC requires Unix) |
| FreeBSD / NetBSD / illumos | cross-compile check only | no hardware test — smol build verified |
Useful links
- ZeroMQ project — the messaging library this implements
- ZeroMQ guide — comprehensive patterns and concepts guide
- ZMTP 3.1 spec (RFC 23) — wire protocol this crate implements
- ZMTP PLAIN (RFC 24) — username/password mechanism
- ZMTP CURVE (RFC 25) — elliptic-curve encryption mechanism
- ZAP (RFC 27) — authentication protocol
- Request/Reply (RFC 28) — REQ/REP/DEALER/ROUTER semantics
- Publish/Subscribe (RFC 29) — PUB/SUB/XPUB semantics
MSRV
Rust 1.85 or later.
Attribution
rustzmq2 is a fork of zeromq/zmq.rs. See CREDITS.md.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
The upstream zeromq/zmq.rs codebase is MIT-only; its original contributors (see CREDITS.md) retain MIT terms for their work. Contributions to this fork are dual-licensed under both MIT and Apache-2.0 unless explicitly stated otherwise.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.