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
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 indocker-compose.yaml:
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.publisherandroles/pubsub.vieweron the topic. - The secret content is the raw JSON of the service account key, not a file path.
pubsub.endpointis set topubsub.googleapis.comfor real GCP (nohttps://prefix, no port suffix, no angle brackets).pubsub.emulator_hostis not set when connecting to real GCP.- After creating the sink, monitor throughput, latency, and successful publish metrics to confirm messages are flowing.