All GCP services

GCP · Application Integration

Pub/Sub

Global async messaging.

Official docs

Overview

Pub/Sub provides at-least-once delivery, push & pull subscriptions, schemas and exactly-once delivery for streaming pipelines.

When to use it

  • Decouple producers/consumers
  • Event-driven test orchestration

Setup

  1. Enable Pub/Sub API.
  2. Create topic and subscription.

How to use

Publish
gcloud pubsub topics publish test-events --message='{"run":"123","status":"fail"}'
Pull
gcloud pubsub subscriptions pull test-events-sub --auto-ack

QA use cases

  • Fan out a 'build green' event to nightly QA jobs, dashboards and Slack.