Message queues
Sink data from RisingWave to Google Pub/Sub
This guide describes how to sink data from RisingWave to Google Pub/Sub using the Google Pub/Sub sink connector in RisingWave. Pub/Sub is used for streaming analytics and data integration pipelines to load and distribute data. For more information, see Google Pub/Sub.
Syntax
Basic parameter
Parameter | Description |
---|---|
pubsub.project_id | Required. The Pub/Sub Project ID. |
pubsub.topic | Required. The Pub/Sub topic to publish messages. |
pubsub.endpoint | Required. The Pub/Sub endpoint URL. |
pubsub.emulator_host | Optional. The Pub/Sub emulator, see Testing locally with Pub/Sub emulator. |
pubsub.credentials | Optional. A JSON string containing the service account credentials for authorization,see Create credentials for a service account. The provided account credential must have the pubsub.publisher role. |
FORMAT and ENCODE option
NOTE
These options should be set in FORMAT data_format ENCODE data_encode (key = 'value')
, instead of the WITH
clause.
Field | Note |
---|---|
data_format | Data format. Allowed format: PLAIN. |
data_encode | Data encode. Supported encode: JSON. |
force_append_only | Required by default and must be true, which forces the sink to be PLAIN (also known as append-only). |
key_encode | Optional. When specified, the key encode can only be TEXT, and the primary key should be one and only one of the following types: varchar, bool, smallint, int, and bigint; When absent, both key and value will use the same setting of ENCODE data_encode ( … ). |
Example
You can test the function locally before you deploying it. See guide on how to Test locally with the Pub/Sub emulator.
Below is the example of how you can configure the docker-compose.yaml
file:
Below is the example of how to create a sink:
Was this page helpful?