Skip to content

ruststream-rumqttc

ruststream-rumqttc is the MQTT 5 broker for the RustStream messaging framework, built on rumqttc. It covers topic filters with wildcards, quality of service, shared subscriptions, retained messages, sessions and wills, and ships an in-process test broker under its testing feature.

Handlers, routers, codecs, and middleware come from the framework; this crate supplies the transport, and nothing broker-specific leaks back into the framework.

MQTT 5 is the target version because two things the framework relies on exist only there: user properties, which carry headers natively instead of through an invented envelope, and shared subscriptions, which make competing consumers expressible.

ruststream = { version = "0.6", features = ["macros", "json"] }
ruststream-rumqttc = "0.6"
serde = { version = "1", features = ["derive"] }
crates/ruststream-rumqttc/examples/mqtt_service.rs
#[ruststream::app]
fn app() -> impl App {
    RustStream::new(AppInfo::new("telemetry", "0.1.0")).with_broker(
        MqttBroker::new("mqtt://localhost:1883", "telemetry-svc")
            .keep_alive(Duration::from_secs(30))
            .clean_start(false)
            .session_expiry(Duration::from_secs(3600)),
        |b| {
            b.include(handle);
        },
    )
}

Where to go next

  • MQTT guide - topic filters, quality of service, shared subscriptions, retained publishes, 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 MQTT broker 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 MQTT and link back to the framework docs where the two meet.