Google Pub/Sub

Datafly Signal publishes events to Google Cloud Pub/Sub topics for real-time messaging, event-driven architectures, and stream processing with downstream subscribers.

Prerequisites

Before configuring Google Pub/Sub in Signal, you need a GCP project with a Pub/Sub topic and a service account with the Pub/Sub Publisher role.

Create a GCP Account and Project

  1. Sign up at cloud.google.com if you don’t already have an account.
  2. Create a new project or select an existing one in the GCP Console.
  3. Note the Project ID.

Enable the Pub/Sub API

  1. Go to APIs & Services > Library.
  2. Search for Cloud Pub/Sub API.
  3. Click Enable.

Create a Pub/Sub Topic

  1. Go to the Pub/Sub console.
  2. Click Create topic.
  3. Enter a Topic ID (e.g. datafly-events).
  4. Optionally add a default subscription (creates a pull subscription automatically).
  5. Click Create.

If you want consumers to receive events, you need at least one subscription attached to the topic. Subscriptions can be created later and can be pull-based, push-based, or BigQuery subscriptions.

Create a Subscription (Optional)

  1. In the Pub/Sub console, click on your topic.
  2. Click Create subscription.
  3. Enter a Subscription ID (e.g. datafly-events-sub).
  4. Choose the delivery type:
    • Pull — consumers poll for messages.
    • Push — Pub/Sub pushes messages to an HTTPS endpoint.
    • BigQuery — writes directly to a BigQuery table.
  5. Set Acknowledgement deadline and Message retention as needed.
  6. Click Create.

Create a Service Account

  1. Go to IAM & Admin > Service Accounts > Create Service Account.
  2. Enter a name (e.g. datafly-signal-pubsub).
  3. Grant the Pub/Sub Publisher role (roles/pubsub.publisher).
  4. Click Done.

Generate a Service Account Key

  1. Click on the service account.
  2. Go to Keys > Add Key > Create new key > JSON.
  3. The key file will download. Store it securely.
⚠️

Store the JSON key file securely. Do not commit it to version control.

Configuration

FieldTypeRequiredDescription
project_idstringYesThe Google Cloud project ID that contains the Pub/Sub topic.
topic_idstringYesThe Pub/Sub topic ID to publish messages to. The topic must already exist.
service_account_jsonsecretYesThe full JSON key file content for a GCP service account with Pub/Sub Publisher permissions.

Signal Setup

Quick Setup

  1. Navigate to Integrations in the sidebar.
  2. Open the Integration Library tab.
  3. Find Google Pub/Sub or filter by Cloud Storage.
  4. Click Install, select a variant if available, and fill in the required fields.
  5. Click Install Integration to create the integration with a ready-to-use default blueprint.

API Setup

curl -X POST http://localhost:8084/v1/admin/integration-catalog/google_pubsub/install \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Google Pub/Sub",
    "variant": "default",
    "config": {
      "project_id": "datafly-analytics",
      "topic_id": "datafly-events",
      "service_account_json": "{\"type\": \"service_account\", ...}"
    },
    "delivery_mode": "server_side"
  }'

Testing

  1. Enable the integration in Signal and trigger a test event on your website.
  2. In the Pub/Sub console, click on a subscription attached to the topic.
  3. Click Messages > Pull to retrieve messages.
  4. Inspect the message body to verify the event data.
  5. In Signal, check the Live Events view to confirm delivery status shows as successful.

Alternatively, use the gcloud CLI:

gcloud pubsub subscriptions pull datafly-events-sub --limit=10 --auto-ack

Troubleshooting

ProblemSolution
Events not appearing in subscriptionsVerify the project ID and topic ID are correct. Ensure at least one subscription exists on the topic.
Permission denied (403)The service account lacks the Pub/Sub Publisher role. Add it in IAM & Admin > IAM.
NOT_FOUND: Topic not foundThe topic does not exist in the specified project. Verify the topic ID.
Invalid service account JSONEnsure you pasted the complete JSON key file content.
Messages not being consumedCheck that a subscription exists and consumers are actively pulling or the push endpoint is reachable.
RESOURCE_EXHAUSTEDYou have exceeded Pub/Sub publish quotas. Check quotas and request an increase.
High publish latencyEnsure the service account and topic are in the same region as your Signal deployment.

Visit Google Pub/Sub documentation for full API reference, subscription types, and dead-letter topic configuration.