Publish
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 *RequiredstringarrayMessage
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
kestra
for internal storage files,file
for host local files, andnsfile
for namespace files. - A JSON String that will then be serialized either as a single item or a list of items.
topic *Requiredstring
The Pub/Sub topic
The Pub/Sub topic. It must be created before executing the task.
impersonatedServiceAccount string
The GCP service account to impersonate.
projectId string
The GCP project ID.
scopes array
["https://www.googleapis.com/auth/cloud-platform"]
The GCP scopes to be used.
serdeType string
STRING
STRING
JSON
The serializer/deserializer to use.
serviceAccount string
The GCP service account.
Outputs
messagesCount integer
Number of published messages.
Definitions
io.kestra.plugin.gcp.pubsub.model.Message
attributes object
The message attributes map
data object
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.
messageId string
The message identifier
orderingKey string
The message ordering key