Google Cloud PubSub Publisher

Google Cloud PubSub Publisher

In this article

 

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

 

Snap Type

The Google PubSub Publisher Snap is a Write type Snap.

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

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

 

  • Min: 1

  • Max: 2

  • Mapper

  • JSON Generator

  • CSV Parser

Each document contains data in the form of json.

Output

Document

  • Min: 0

  • Max: 1

  • JSON Generator

Each document contains corresponding response in the form of json.

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution: Stops the current Pipeline execution when the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the remaining records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

Field Name

Field type

Description

Field Name

Field type

Description

Label*

 

 

String

Specify the name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.


Default value: PubSub Publisher
Example: Publish topics

Topic name*

 

 

String/Expression/Suggestion

Specify the topic to publish to. The property is suggestable and will retrieve available topic names based on the project ID. If the topic name is not found in the PubSub, the snap will create 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 will batch before publishing.


Default value: 1
Example: 1

Snap Execution

 

 

Dropdown list

Select 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 ValueExecute only
Example: Validate & Execute

 

Snap Pack History

 


Related Content