/
Google PubSub Publisher

Google 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-pubsub-pubisher-overview.png

 

Snap Type

The Google PubSub Publisher Snap is a Read type Snap.

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*

 

Default value: Google PubSub Publisher
Example: Google PubSub Publisher

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.

Topic name*

 

Default value: N/A
Example: my-topic

String/Expression/Suggestion

Specify the topic to publish to. The property is suggestable and will retrieve available topic names based on the project ID. The snap will create the topic if the topic name is not found in the PubSub.

Create Topic


Default state: Deselected

Checkbox

Select this checkbox to create a topic if one doesn’t exist.

Message

 

Default value: N/A
Example: New order

String/Expression

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

 

Message Properties

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

Key


Default value: N/A
Example: source

String/Expression

Specify the key of the message attribute.

Value


Default value: N/A
Example: ecommerce-system

String/Expression

Specify the value for the above-mentioned key attribute.

Batch size

 

Default value: 1
Example: 1

Integer/Expression

The number of documents the Snap will batch before publishing. The default is 1.

 

Snap Execution

 

Default ValueExecute only
Example: Validate & Execute

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.

Snap Pack History