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
  • 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.

impersonatedServiceAccount

  • Type: string
  • Dynamic: ✔️
  • Required:

The GCP service account to impersonate.

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.

Outputs

messagesCount

  • Type: integer
  • Required:

Definitions

io.kestra.plugin.gcp.pubsub.model.Message

  • attributes
    • Type: object
    • SubType: string
    • Dynamic: ✔️
    • Required:
  • data
    • Type: object
    • Dynamic: ✔️
    • Required:
  • messageId
    • Type: string
    • Dynamic: ✔️
    • Required:
  • orderingKey
    • Type: string
    • Dynamic: ✔️
    • Required: