Skip to content

ruststream-gcp-pubsub

ruststream-gcp-pubsub is the Google Cloud Pub/Sub broker for the RustStream messaging framework, built on the official google-cloud-pubsub client. A streaming pull subscription becomes the framework's message stream, acknowledgement is native per message (with the confirmed forms on exactly-once subscriptions), and ordering keys map onto the framework's partition key.

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

ruststream = { version = "0.6", features = ["macros", "json"] }
ruststream-gcp-pubsub = "0.6"
serde = { version = "1", features = ["derive"] }

The crate is published on crates.io and tracks the ruststream 0.6 line. Its MSRV is 1.88, tracking the official client; the framework core stays at 1.85.

crates/ruststream-gcp-pubsub/examples/pubsub_service.rs
#[ruststream::app]
fn app() -> impl App {
    RustStream::new(AppInfo::new("orders", "0.1.0")).with_broker(
        PubSubBroker::new("my-project").emulator("localhost:8085"),
        |b| b.include(handle),
    )
}

Where to go next

  • Pub/Sub guide - subscriptions, acknowledgement, ordering keys, the emulator, 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 Pub/Sub 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 Pub/Sub and link back to the framework docs where the two meet.