Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Source: Google Cloud Pub/Sub

The Pub/Sub source subscribes to a Google Cloud Pub/Sub subscription and delivers messages into a pg_tide inbox.

Configuration

SELECT tide.relay_set_inbox_v2(
  jsonb_build_object(
    'name', 'events-from-pubsub',
    'inbox', 'incoming_events',
    'source', 'pubsub',
    'config', '{
        "project_id": "${env:GCP_PROJECT_ID}",
        "subscription": "pg-tide-sub",
        "credentials_json": "${file:/etc/gcp/sa.json}",
        "batch_size": 100
    }'::jsonb
  )
);

Configuration Reference

ParameterTypeDefaultDescription
source_typestring—Must be "pubsub"
project_idstring—GCP project ID
subscriptionstring—Pub/Sub subscription name
credentials_jsonstringnullService account JSON
batch_sizeint100Messages per pull
ack_deadline_secsint30Acknowledgment deadline

Delivery Guarantees

Messages are acknowledged only after inbox insertion. The inbox deduplicates using the Pub/Sub message ID. Unacknowledged messages are redelivered after the ack deadline expires.

Further Reading