Publish
yaml
type: "io.kestra.plugin.gcp.pubsub.Publish"
Publish a message to a Pub/Sub topic
Examples
yaml
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
- 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.
serdeType
- Type: string
- Dynamic: ❌
- Required: ✔️
- Default:
STRING
- Possible Values:
STRING
JSON
The serializer/deserializer to use.
topic
- Type: string
- Dynamic: ✔️
- Required: ✔️
The Pub/Sub topic
The Pub/Sub topic. It must be created before executing the task.
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 be used.
serviceAccount
- Type: string
- Dynamic: ✔️
- Required: ❌
The GCP service account key.
Outputs
messagesCount
- Type: integer
- Required: ❌
Number of published messages.
Definitions
io.kestra.plugin.gcp.pubsub.model.Message
Properties
attributes
- Type: object
- SubType: string
- Dynamic: ✔️
- Required: ❌
The message attributes map
data
- Type: object
- Dynamic: ✔️
- Required: ❌
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
- Type: string
- Dynamic: ✔️
- Required: ❌
The message identifier
orderingKey
- Type: string
- Dynamic: ✔️
- Required: ❌
The message ordering key
Was this page helpful?