Message Subscriber Trigger

The message subscriber trigger subscribes to preconfigured subscriptions and receives messages from the Google Cloud Pub/Sub service. Each message that is received, triggers a new flow instance.

Note: In a container deployment, when the application with subscriber trigger is scaled, each instance receives a subset of messages (any number of messages) published on a given topic. The messages are not equally distributed across application instances.
Trigger Settings

The Trigger Settings tab has the following fields:

Field Description
Google Pub/Sub Connection

(Required: Yes)

Select the Google Pub/Sub Connection

Subscription ID

(Required: Yes)

Configure the ID of the subscription to receive messages. The subscription with the given ID must be available in the Google Cloud Pub/Sub project. You can also configure the subscription name.

Max Outstanding Messages

(Required: No)

Maximum number of unprocessed (unacknowledged but not yet expired) messages received by the subscriber before the trigger is paused.

Default: 1000

Warning: The total number of concurrent messages processed by the engine are determined by the value of FLOGO_RUNNER_WORKERS when engine mode is set to POOLED (default mode). So, it is recommended to set FLOGO_RUNNER_WORKERS to Max Outstanding Messages for better performance. This setting is not required when engine mode is set to DIRECT. For more information on engine modes, see the "Performance Tuning" topic in the Flogo® App documentation.
Enable Flow Control

(Required: No)

Control the processing of messages received from the Google Cloud Pub/Sub service. The following options are available:

True: The trigger pulls Max Outstanding Messages from the service and pauses until all the messages are processed.
False: The trigger continuously receives messages from the service and processes them concurrently. By default, the Enable Flow Control is set to False.
Note: When total unprocessed messages >= MaxOutstandingMessages, the server stops sending messages until unprocessed messages < MaxOutstandingMessages.
Message Data Format

(Required: Yes)

Format of the received data. For JSON format, configure the JSON schema or sample JSON data on the Output Settings tab. By default the data format is set to String.

Output Settings

The Output Settings tab has the following fields:

Field Description
Schema for JSON data

(Required: No)

Applicable when Message Data Format on the Trigger Settings tab is set to JSON. Enter the JSON schema or JSON sample payload for the message data.

Message Attributes

(Required: No)

Message attributes received.

Map to Flow Inputs

The Map to Flow Inputs tab has the following fields:

Field Description
message

(Required: Yes)

Message data received. When Message Data Format on the Trigger Settings tab is set to String, data type is string. When Message Data Format on the Trigger Settings tab is set to JSON, the data type is JSON object.

metadata

(Required: No)

Message metadata includes the following fields:

messageAttributes: Message attributes received from the message.
messageId: ID of the received message.
deliveryAttempt: When dead lettering is enabled for the subscription, this value is set to redelivery attempt; otherwise, it is always 0.