Skip to main content

Topics and Subscriptions

The core logic of Pub/Sub relies on routing data accurately from services.

Concept Flow

  1. A Publisher creates a message and sends it to a specific Topic.
  2. A Topic acts as a broadcasting channel.
  3. A Subscription connects to a topic and receives broadcasts from it.

Push vs Pull Subscriptions

  • Push: Pub/Sub automatically fires an HTTP POST request to a Webhook URL you provide as soon as a message hits the Topic. Excellent for Serverless APIs.
  • Pull: The subscribing worker server manually reaches out to the Pub/Sub API and asks "Are there any new messages for me?" Excellent for securing internal VPC workers that lack public endpoints.