Skip to content
Cloud
Docs

Pub/Sub

Pub/Sub delivers durable messages between producers and consumers. Producers publish to a Project-owned Topic, and consumers pull messages through Subscriptions with independent acknowledgment state.

Why use Pub/Sub?

A producer may need to hand work to another component without waiting for that component to finish. Pub/Sub provides a stored message stream for that handoff. Separate Subscriptions let different consumers process messages from the same Topic independently.

What you can do

  • Create Topics and configure message retention.
  • Create Subscriptions with their own retention and acknowledgment deadlines.
  • Publish message data with optional attributes, then pull deliveries for processing.
  • Acknowledge completed deliveries and pause or resume Subscriptions.

Core concepts

A Topic is the feed that receives published messages. A Subscription tracks delivery from one Topic. A pulled delivery includes an acknowledgment token that the consumer uses after processing.

Topic bindings grant Projects permission to publish or subscribe. Keep message processing separate from acknowledgment, and consult the API reference for delivery controls and retention settings.

Use Pub/Sub

Read the CLI reference for commands or the API reference for resources, request fields, and responses.