Skip to main content

Syntax

Basic parameters

FORMAT and ENCODE options

These options should be set in FORMAT data_format ENCODE data_encode (key = 'value'), instead of the WITH clause.

IAM requirements

The service account used by the connector must have the following IAM roles on the target Pub/Sub topic: Grant both roles using the Google Cloud Console or the gcloud CLI:
Example

Using Google Cloud Pub/Sub (non-emulator)

This section describes how to connect RisingWave to a real Google Cloud Pub/Sub topic.

Step 1: Store the service account key as a secret

CREATE SECRET stores a literal string value in RisingWave metadata. For Pub/Sub, pass the raw JSON content of the service account key file — not a file path.
Example
Paste the raw JSON content directly. Do not pass a file path such as /home/user/key.json. Passing a file path instead of the JSON content will cause authentication to fail.

Step 2: Create the sink

Example

Example: local emulator

You can test the connector locally before deploying to Google Cloud. See Test locally with the Pub/Sub emulator. Configure the emulator in docker-compose.yaml:
Create the sink pointing at the emulator:
Do not set pubsub.emulator_host when connecting to real Google Cloud. This parameter disables TLS and authentication, which are required for GCP.

Validation checklist

Before creating the sink, verify the following:
  • The Pub/Sub topic exists in the specified project.
  • The service account has both roles/pubsub.publisher and roles/pubsub.viewer on the topic.
  • The secret content is the raw JSON of the service account key, not a file path.
  • pubsub.endpoint is set to pubsub.googleapis.com for real GCP (no https:// prefix, no port suffix, no angle brackets).
  • pubsub.emulator_host is not set when connecting to real GCP.
  • After creating the sink, monitor throughput, latency, and successful publish metrics to confirm messages are flowing.

Common misconfigurations