Google Cloud Pub/Sub ingests events for streaming into BigQuery, data lakes, or operational databases. Tenzir can act as a publisher that sends messages to a topic, and as a subscriber that receives messages from a subscription.
Examples
Section titled “Examples”Publish a message to a topic
Section titled “Publish a message to a topic”from {foo: 42}to_google_cloud_pubsub project_id="my-project", topic_id="my-topic", message = this.print_ndjson()Receive messages from a subscription
Section titled “Receive messages from a subscription”Assuming a connection between my-topic and my-subscription:
from_google_cloud_pubsub project_id="my-project", subscription_id="my-subscription"parsed = message.parse_json() // The `message` field is a string{ message: "{\"foo\": 42}" parsed: {foo: 42}}