/
Google PubSub Subscriber

Google PubSub Subscriber

YoIn this article

Overview

You can use this Snap to subscribe or pull messages from Google Pubsub topic using the subscription name. This uses the Synchronous Pull under-pull subscription method.

google-pubsub-subscriber-overview.png

Snap Type

The Google PubSub Subscriber Snap is a Read-type Snap.

Snap Views

0Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

0Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

 

  • Min: 0

  • Max: 1

  • Mapper

  • JSON Generator

  • CSV Parser

Each document contains data in the form of JSON..

Output

Document

  • Min: 1

  • Max: 1

  • JSON Generator

Each document contains a corresponding JSON response.

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

  • Asterisk (*): Indicates a mandatory field.

  • Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon (): Indicates whether the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon (): Indicates that you can add fields in the field set.

  • Remove icon (): Indicates that you can remove fields from the field set.

Field Name

Field Type

Description

Field Name

Field Type

Description

Label*

Default Value: Google PubSub Subscriber
Example: Google PubSub Subscriber

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.

Subscription name*

Default Value: N/A
Example: my-topic-subscription

String/Expression/Suggestion

Specify the subscription name from which messages are to be pulled, The property is suggestable and will retrieve available subscription names based on the Project ID from the service account.

 

Message Count

Default Value: 1000
Example: 1000

Integer/Expression

Specify the maximum number of messages to read before execution stops. The Snap pulls the messages until the message count reaches.

The default batch size for each pull request is 1000. If the requested message count is less than 1000, then the batch size will be set to the message count before subscribing to the messages.

Handle Binary Format

 

Default state: Deselected

Checkbox/Expression

Select this checkbox to handle binary messages by converting them to Base 64 to preserve format. Use base64 decode to get the actual binary message.

Timestamp

Default Value: N/A
Example:

  • 2019-07-10

  • 2019-07-10T10:10:00

Integer/Expression

Specify the specific time before subscribing to the messages. The supported formats are : yyyy-MM-dd'T'HH:mm:ss or yyyy-MM-dd

 

Snapshot name

Default Value: N/A
Example: my-topic-snapshot

String/Expression

Specify the snapshot name before subscribing the messages. The property is suggestable and retrieves available snapshot names based on the subscription names.

 

Auto  Acknowledge

Default state: Deselected

Checkbox/Expression

Select this checkbox to auto-acknowledge the received messages. If selected, the Snap acknowledges the receipt of a message when the message listener returns successfully.

If you deselect this checkbox, the same data can be pulled, which means duplicate data is displayed in the output.

Fetching Time Out

Default Value: 30
Example: 50

String/Expression

Specify the maximum time in seconds the Snap will wait for each fetching. A zero wait timeout means that fetching will be performed without waiting.

 

Snap Execution

Default Value: Validate & Execute
Example: Execute only

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