Publish
type: "io.kestra.plugin.gcp.pubsub.Publish"
Publish a message to a Pub/Sub topic
# Examples
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
- Type:
string
array
Message - Dynamic: ✔️
- Required: ✔️
The source of the published data.
Can be an internal storage URI, a list of Pub/Sub messages, or a single Pub/Sub message.
# projectId
- Type: string
- Dynamic: ✔️
- Required: ❌
The GCP project id
# scopes
- Type: array
- SubType: string
- Dynamic: ✔️
- Required: ❌
- Default:
[https://www.googleapis.com/auth/cloud-platform]
The GCP scopes to used
# serviceAccount
- Type: string
- Dynamic: ✔️
- Required: ❌
The GCP service account key
# topic
- Type: string
- Dynamic: ✔️
- Required: ❌
The Pub/Sub topic
The Pub/Sub topic. It must be created before executing the task.
# Outputs
# messagesCount
- Type: integer
Number of published messages.
# Definitions
# Message
# attributes
- Type: object
- SubType: string
- Dynamic: ✔️
- Required: ❌
The message attribute map
# data
- Type: string
- Dynamic: ✔️
- Required: ❌
The message data, must be base64 encoded
# messageId
- Type: string
- Dynamic: ✔️
- Required: ❌
The message identifier
# orderingKey
- Type: string
- Dynamic: ✔️
- Required: ❌
The message ordering key