Skip to content

ruststream-zeromq

ruststream-zeromq is the ZeroMQ transport for the RustStream messaging framework, built on the pure-Rust zeromq implementation over the TCP and IPC transports.

Unlike every other broker crate there is no server in the middle, and that is the reason it exists: a Rust service can join a ZeroMQ topology an existing Python worker or C++ daemon already speaks, without leaving the framework. Handlers, routers, codecs, and middleware come from the framework; this crate supplies the sockets and a documented frame layout the peer on the other side can compose by hand.

Three socket patterns cover three messaging shapes: ZmqQueue (PUSH/PULL, competing consumers), ZmqFanout (PUB/SUB, broadcast with prefix filtering), and ZmqRpc (DEALER/ROUTER, request and reply).

ruststream = { version = "0.6", features = ["macros", "json"] }
ruststream-zeromq = "0.6"
serde = { version = "1", features = ["derive"] }
crates/ruststream-zeromq/examples/zmq_pipeline.rs
#[ruststream::app]
fn app() -> impl App {
    RustStream::new(AppInfo::new("worker", "0.1.0")).with_broker(
        ZmqQueue::new(ZmqEndpoint::bind("tcp://0.0.0.0:5555")),
        |b| {
            b.include(handle);
        },
    )
}

Where to go next

  • ZeroMQ guide - the three patterns, endpoints, the wire contract, request/reply, and testing.
  • RustStream docs - the framework itself: subscribers, routing, codecs, middleware, the CLI.
  • API reference - the crate's rustdoc on docs.rs.

How this site relates to the RustStream docs

This site documents the ZeroMQ transport only. Framework concepts that apply to every broker (writing subscribers, publishing, routing, codecs, middleware, observability, the CLI) live in the RustStream documentation. The pages here cover what is specific to ZeroMQ and link back to the framework docs where the two meet.