Google Cloud PubSub Publisher

Overview

You can use this Snap to publish messages from the input into the Google PubSub for the given topic name. This Snap is supported for both publishing a single message or bulk messages based on the batch size.


Google Cloud PubSub Publisher overview

Limitations

Publisher creates a default topic, but if you want to create a topic with advanced properties, you must configure that on the Google console.

Snap views

Type Description Examples of upstream and downstream Snaps
Input

Document

  • Min: 1
  • Max: 2

Each document contains data in the form of JSON.

  • Mapper
  • JSON Generator
  • CSV Parser
Output

Document

  • Min: 0
  • Max: 1

Each document contains a corresponding response in the form of JSON.

  • JSON Generator
Learn more about Error handling.

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description
Label

String

Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: PubSub Publisher

Example: Publish topics

Topic name

String/Expression/ Suggestion

Specify the topic to publish to. The property retrieves available topic names based on the project ID, but suggestions are not displayed for accounts with the Pub/Sub Publisher role; enter the topic name manually for those accounts. If the topic name is not found in PubSub, the Snap creates it.

Default value: N/A

Example: my-topic

Message

String/Expression

Specify the text to publish to the Google PubSub system for the selected topic name.

Default value: N/A

Example: New order

Message Properties Use this field set to configure the keys and value properties for the messages to be published.
Key

String/Expression

Specify the key of the message attribute.

Default value: N/A

Example: source

Value

String/Expression

Specify the value for the above-mentioned key attribute.

Default value: N/A

Example: ecommerce-system

Batch size

Integer/Expression

Specify the number of documents the Snap batches before publishing.

Default value: 1

Example: 1

Snap Execution

Dropdown list

Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Execute only