Publish a message to a Google Pub/Sub topic.
type: "io.kestra.plugin.gcp.pubsub.publish"Examples
id: gcp_pubsub_publish
namespace: company.team
tasks:
- id: publish
type: io.kestra.plugin.gcp.pubsub.Publish
topic: topic-test
from:
- data: "{{ 'base64-encoded-string-1' | base64encode }}"
attributes:
testAttribute: KestraTest
- messageId: '1234'
- orderingKey: 'foo'
- data: "{{ 'base64-encoded-string-2' | base64encode }}"
- attributes:
testAttribute: KestraTest
Properties
from*Requiredstringarray
Structured data items, either as a map, a list of map, a URI, or a JSON string.
Structured data items can be defined in the following ways:
- A single item as a map (a document).
- A list of items as a list of maps (a list of documents).
- A URI, supported schemes are
kestrafor internal storage files,filefor host local files, andnsfilefor namespace files. - A JSON String that will then be serialized either as a single item or a list of items.
io.kestra.plugin.gcp.pubsub.model.Message
The message attributes map
The message data, must be a string if serde type is 'STRING', otherwise a JSON object
If it's a string, it can be a dynamic property otherwise not.
The message identifier
The message ordering key
topic*Requiredstring
The Pub/Sub topic
The Pub/Sub topic. It must be created before executing the task.
impersonatedServiceAccountstring
The GCP service account to impersonate.
projectIdstring
The GCP project ID.
scopesarray
["https://www.googleapis.com/auth/cloud-platform"]The GCP scopes to be used.
serdeTypestring
STRINGSTRINGJSONThe serializer/deserializer to use.
serviceAccountstring
The GCP service account.
Outputs
messagesCountinteger
Number of published messages.
Metrics
recordscounter
recordsNumber of records published to the Pub/Sub topic.