with-agents

Pub/Sub Made Easy

Cloud Pub/Sub in Action - ep. 3

A ten-episode progression through topics, subscriptions, clients, endpoints, and replay

Ten 2019–2020 episodes follow a message from publication to independent subscription backlogs, delivery, acknowledgement, and replay. Examples compare push and pull consumers and connect them to serverless endpoints.

Google Cloud Tech 3 of 10
In this collection Browse 10 summaries 3 of 10

An order service publishes an “order received” message that both packaging and notification need to process. This console-and-Python walkthrough gives each consumer its own Pub/Sub subscription, then shows why one consumer can start late without missing its message.

Key points

  • The topology gives each consumer a subscription: The order publisher writes to one topic, while packaging and notification each receive through their own pull subscription 00:00–02:09(opens in a new tab).
  • The 2019 demo shares one identity across three processes: It grants publisher and subscriber roles to one service account and uses a downloaded JSON key for the local Python samples. This is historical demo setup, not a recommendation to share long-lived credentials in a deployment 02:09–05:20(opens in a new tab).
  • Acknowledgement advances one subscription's state: When packaging acknowledges the message, Pub/Sub removes it from the packaging backlog, not from the notification subscription 05:20–06:23(opens in a new tab).
  • A late subscriber still receives its own copy: Notification starts after publication but receives the message already retained for its subscription 05:20–06:23(opens in a new tab).

Full video: https://www.youtube.com/watch?v=f5DOsB7Nlw0(opens in a new tab)

Search

Search field guides and resources across the site.

    Keyboard shortcuts

    Press ? to open this guide (usually Shift + /). Close it before using other site shortcuts.

    Show keyboard shortcuts
    ?
    Search site
    Ctrl + K
    Close the current dialog or menu
    Esc

    Site shortcuts are ignored while typing. Browser and extension shortcuts may take priority.