---
schema_version: "1"
id: 6bd0a811423b5c74313b3f8354671f60b5ac94c4ca83d3d9b641b2ca2d399755
title: Google Pub/Sub Connector 1.0 Reference
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/google-pubsub-connector/1.0/google-pubsub-connector-reference.md
canonical_url: https://docs.mulesoft.com/google-pubsub-connector/1.0/google-pubsub-connector-reference
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e35de7c74c122254881e4f3d3822fadca1d51e915ac6475290499e4b4b45fb91
description: MuleSoft Documentation Site
release: "1.0"
latest: false
---
---
product: Google Pub/Sub Connector
version: 1.0
---

# Google Pub/Sub Connector 1.0 Reference

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## Configurations

---

### Configuration

#### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Name</p></td><td><p>String</p></td><td><p>Name for this configuration. Connectors reference the configuration with this name.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Connection</p></td><td><div><div><p><a href="#Config_Connection">PubSub Connection</a></p></div></div></td><td><p>Connection types for this configuration.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Default Project Id</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project. Used in operations. It can be overridden at the config level.</p></td><td></td><td></td></tr><tr><td><p>Default Subscription Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Default subscription for your project. Used in operations. It can be overridden at the config level.</p></td><td></td><td></td></tr><tr><td><p>Default Topic Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Default topic for your project. Used in operations. It can be overridden at the config level.</p></td><td></td><td></td></tr><tr><td><p>Name</p></td><td><div><div><p>String</p></div></div></td><td><p>ID used to reference this configuration.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Expiration Policy</p></td><td><div><div><p><a href="#ExpirationPolicy">Expiration Policy</a></p></div></div></td><td><p>Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.</p></td><td></td><td></td></tr></tbody></table>

#### Connection Types

##### PubSub Connection

###### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Private key ID</p></td><td><div><div><p>String</p></div></div></td><td><p>ID of the private key for the service account. It is a part of the service-credentials created in PubSub.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Client ID</p></td><td><div><div><p>String</p></div></div></td><td><p>ID of the client for the service account. It is a part of the service-credentials created in PubSub.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Client email</p></td><td><div><div><p>String</p></div></div></td><td><p>Client email for the service account. It is a part of the service-credentials created in PubSub.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Private key</p></td><td><div><div><p>String</p></div></div></td><td><p>Private key for the service account. It is a part of the service-credentials created in PubSub.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Message Count Batch Size</p></td><td><div><div><p>Number</p></div></div></td><td><p>Maximum number of messages in the batch. After the maximum number of messages is reached, the elements are wrapped up in a batch and sent.</p></td><td><p>10</p></td><td></td></tr><tr><td><p>Request Size Threshold</p></td><td><div><div><p>Number</p></div></div></td><td><p>Maximum memory size of the messages in the batch. After the maximum memory size is reached, the elements are wrapped up in a batch and sent.</p></td><td><p>1</p></td><td></td></tr><tr><td><p>Request Size Threshold Unit</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>BYTE</p></li><li><p>KB</p></li><li><p>MB</p></li><li><p>GB</p></li></ul></div></div></td><td><p>Data unit for the <strong>Request Size Threshold</strong> field.</p></td><td><p>KB</p></td><td></td></tr><tr><td><p>Publish Delay Threshold</p></td><td><div><div><p>Number</p></div></div></td><td><p>Maximum delay threshold to use for batching. After the maximum amount of time has elapsed (counting from the first element added), the elements are wrapped up in a batch and sent. This value must not be set too high, especially for the <code>MILLISECONDS</code> time unit. Otherwise, calls might appear to never complete.</p></td><td><p>10</p></td><td></td></tr><tr><td><p>Publish Delay Threshold Time Unit</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>NANOSECONDS</p></li><li><p>MICROSECONDS</p></li><li><p>MILLISECONDS</p></li><li><p>SECONDS</p></li><li><p>MINUTES</p></li><li><p>HOURS</p></li><li><p>DAYS</p></li></ul></div></div></td><td><p>Time unit for the <strong>Publish Delay Threshold</strong> field.</p></td><td><p>MILLISECONDS</p></td><td></td></tr><tr><td><p>Enable batching</p></td><td><div><div><p>Boolean</p></div></div></td><td><p>Flag for enabling or disabling publish request batching.</p></td><td><p>false</p></td><td></td></tr><tr><td><p>Limit Exceeded Behavior</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>THROW_EXCEPTION</p></li><li><p>BLOCK</p></li><li><p>IGNORE</p></li></ul></div></div></td><td><div><div><p>If not set to <code>IGNORE</code>, flow control enables you to control the publishing behavior by specifying limits for <strong>Max Outstanding Request Size</strong> and <strong>Max Outstanding Element Count</strong>.</p></div><div><ul><li><p><code>THROW_EXCEPTION</code></p><div><p>If the memory size or the amount of outstanding elements (messages where no Ack() or Nack() was performed) exceeds the specified limits, the publisher throws a <code>FlowControlException</code>.</p></div></li><li><p><code>BLOCK</code></p><div><p>If the memory size or the amount of outstanding elements (messages where no Ack() or Nack() was performed) exceeds the specified limits, the publisher does not publish more messages.</p></div></li><li><p><code>IGNORE</code></p><div><p>The publisher does not account for specified limits and does not control the message publishing rate.</p></div></li></ul></div></div></td><td></td><td></td></tr><tr><td><p>Max Outstanding Request Size</p></td><td><div><div><p>Number</p></div></div></td><td><p>Maximum amount of memory accumulated by the request before enforcing flow control.</p></td><td><p>100</p></td><td></td></tr><tr><td><p>Max Outstanding Request Size Unit</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>BYTE</p></li><li><p>KB</p></li><li><p>MB</p></li><li><p>GB</p></li></ul></div></div></td><td><p>Data unit for the <strong>Max Outstanding Request Size</strong> field.</p></td><td><p>MB</p></td><td></td></tr><tr><td><p>Max Outstanding Element Count</p></td><td><div><div><p>Number</p></div></div></td><td><p>Maximum number of outstanding elements to keep in memory before enforcing flow control.</p></td><td><p>100</p></td><td></td></tr><tr><td><p>Reconnection</p></td><td><div><div><p><a href="#Reconnection">Reconnection</a></p></div></div></td><td><p>Configures a reconnection strategy to use when a connector operation fails to connect to an external server.</p></td><td></td><td></td></tr></tbody></table>

## Supported Operations

- [Create Snapshot](#CreateSnapshot)

- [Delete Snapshot](#DeleteSnapshot)

- [Get Snapshot](#GetSnapshot)

- [Get Snapshot List](#GetSnapshotList)

- [Patch Snapshot](#PatchSnapshot)

- [Publish Message](#PublishMessage)

- [Seek Messages](#SeekMessages)

## Associated Sources

- [On message listener](#MessageListener)

## Operations

## Create Snapshot

`<pubsub:create-snapshot>`

Creates a snapshot from the requested subscription. Use snapshots in seek operations, which manage
message acknowledgments in bulk. This operation enables you to set the acknowledgment state of
messages in an existing subscription to the state captured by a snapshot.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Snapshot Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Project-wide unique identifier for a snapshot.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Labels</p></td><td><div><div><p>Object</p></div></div></td><td><p>Key-value pairs that help users to organize Google Cloud resources. Attaching labels to resources filters them based on the labels.</p></td><td></td><td></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Project ID</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project.</p></td><td></td><td></td></tr><tr><td><p>Subscription Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Project-wide unique identifier for the subscription.</p></td><td></td><td></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the variable that stores the operation’s output.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>Expression that evaluates the operation’s output. The outcome of the expression is stored in the <strong>Target Variable</strong> field.</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Type</p></td><td><p><a href="#Snapshot">Snapshot</a></p></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

### Throws

- PUBSUB:ALREADY\_EXISTS

- PUBSUB:BAD\_GATEWAY

- PUBSUB:CANCELLED

- PUBSUB:CONNECTIVITY

- PUBSUB:DEADLINE\_EXCEEDED

- PUBSUB:FAILED\_PRECONDITION

- PUBSUB:INVALID\_ARGUMENT

- PUBSUB:NOT\_FOUND

- PUBSUB:PERMISSION\_DENIED

- PUBSUB:RETRY\_EXHAUSTED

- PUBSUB:UNAVAILABLE

## Delete Snapshot

`<pubsub:delete-snapshot>`

Deletes an existing snapshot.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Project ID</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project.</p></td><td></td><td></td></tr><tr><td><p>Snapshot Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Project-wide unique identifier for a snapshot.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

### Throws

- PUBSUB:BAD\_GATEWAY

- PUBSUB:CANCELLED

- PUBSUB:CONNECTIVITY

- PUBSUB:DEADLINE\_EXCEEDED

- PUBSUB:FAILED\_PRECONDITION

- PUBSUB:INVALID\_ARGUMENT

- PUBSUB:NOT\_FOUND

- PUBSUB:PERMISSION\_DENIED

- PUBSUB:RETRY\_EXHAUSTED

- PUBSUB:UNAVAILABLE

## Get Snapshot

`<pubsub:get-snapshot>`

Retrieves a snapshot.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Project ID</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project.</p></td><td></td><td></td></tr><tr><td><p>Snapshot Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Project-wide unique identifier for a snapshot.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the variable that stores the operation’s output.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>Expression that evaluates the operation’s output. The outcome of the expression is stored in the <strong>Target Variable</strong> field.</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Type</p></td><td><p><a href="#Snapshot">Snapshot</a></p></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

### Throws

- PUBSUB:BAD\_GATEWAY

- PUBSUB:CANCELLED

- PUBSUB:CONNECTIVITY

- PUBSUB:DEADLINE\_EXCEEDED

- PUBSUB:FAILED\_PRECONDITION

- PUBSUB:INVALID\_ARGUMENT

- PUBSUB:NOT\_FOUND

- PUBSUB:PERMISSION\_DENIED

- PUBSUB:RETRY\_EXHAUSTED

- PUBSUB:UNAVAILABLE

## Get Snapshot List

`<pubsub:get-snapshot-list>`

Retrieves a list of existing snapshots from a selected project.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Project Id</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project.</p></td><td></td><td></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Streaming Strategy</p></td><td><div><div><ul><li><p><a href="#RepeatableInMemoryIterable">Repeatable In Memory Iterable</a></p></li><li><p><a href="#RepeatableFileStoreIterable">Repeatable File Store Iterable</a></p></li><li><p>non-repeatable-iterable</p></li></ul></div></div></td><td><p>Configures how Mule processes streams. The default is to use repeatable streams.</p></td><td></td><td></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the variable that stores the operation’s output.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>Expression that evaluates the operation’s output. The outcome of the expression is stored in the <strong>Target Variable</strong> field.</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Type</p></td><td><p>Array of <a href="#Snapshot">Snapshot</a></p></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

### Throws

- PUBSUB:BAD\_GATEWAY

- PUBSUB:CANCELLED

- PUBSUB:DEADLINE\_EXCEEDED

- PUBSUB:FAILED\_PRECONDITION

- PUBSUB:INVALID\_ARGUMENT

- PUBSUB:NOT\_FOUND

- PUBSUB:PERMISSION\_DENIED

- PUBSUB:UNAVAILABLE

## Patch Snapshot

`<pubsub:patch-snapshot>`

Updates an existing snapshot. The name and the topic of the snapshot are not mutable fields and
cannot be updated.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Snapshot</p></td><td><div><div><p><a href="#Snapshot">Snapshot</a></p></div></div></td><td><p>Snapshot object with updated fields (labels or expireTime).</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Update Mask</p></td><td><div><div><p>String</p></div></div></td><td><p>Indicates which fields in the provided snapshot to update. Must be specified and non-empty. This is a comma-separated list of fully qualified names of fields.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the variable that stores the operation’s output.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>Expression that evaluates the operation’s output. The outcome of the expression is stored in the <strong>Target Variable</strong> field.</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Type</p></td><td><p><a href="#Snapshot">Snapshot</a></p></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

### Throws

- PUBSUB:BAD\_GATEWAY

- PUBSUB:CANCELLED

- PUBSUB:CONNECTIVITY

- PUBSUB:DEADLINE\_EXCEEDED

- PUBSUB:FAILED\_PRECONDITION

- PUBSUB:INVALID\_ARGUMENT

- PUBSUB:NOT\_FOUND

- PUBSUB:PERMISSION\_DENIED

- PUBSUB:RETRY\_EXHAUSTED

- PUBSUB:UNAVAILABLE

## Publish Message

`<pubsub:publish-message>`

Publishes a single message.

This operation is non-blocking. When batching is enabled, the message is stored only locally until
any of the batching restrictions are reached.

This operation may lead to high throughput. When using the **Ordering Key** field, processing
messages in the order they were called is not guaranteed, especially in threaded environments. If
you must maintain a strict order, set **Max Concurrency** to `1` in your source flow settings and
add a delay in the for-each loops that contain order critical **Publish** calls.

This operation returns the `messageId`, which is the unique identifier of the sent message in the
topic.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Ordering Key</p></td><td><div><div><p>String</p></div></div></td><td><p>If specified, this field identifies related messages in which the publish order must be respected when the subscriber enables message ordering.</p></td><td></td><td></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Project ID</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project.</p></td><td></td><td></td></tr><tr><td><p>Topic Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Project-wide unique identifier for the topic.</p></td><td></td><td></td></tr><tr><td><p>Message</p></td><td><div><div><p>Binary</p></div></div></td><td><p>Message content published to the topic. If not empty, the message must contain at least one attribute.</p></td><td></td><td></td></tr><tr><td><p>Attributes</p></td><td><div><div><p>Object</p></div></div></td><td><p>Attributes for this message. If empty, the message must contain non-empty data. Can be used to filter messages on the subscription.</p></td><td></td><td></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the variable that stores the operation’s output.</p></td><td></td><td></td></tr><tr><td><p>Target Value</p></td><td><div><div><p>String</p></div></div></td><td><p>Expression that evaluates the operation’s output. The outcome of the expression is stored in the <strong>Target Variable</strong> field.</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Type</p></td><td><p>String</p></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

### Throws

- PUBSUB:BAD\_GATEWAY

- PUBSUB:CANCELLED

- PUBSUB:CONNECTIVITY

- PUBSUB:DEADLINE\_EXCEEDED

- PUBSUB:FAILED\_PRECONDITION

- PUBSUB:INVALID\_ARGUMENT

- PUBSUB:MAX\_OUTSTANDING\_BATCH\_SIZE\_REACHED

- PUBSUB:MAX\_OUTSTANDING\_ELEMENT\_COUNT\_REACHED

- PUBSUB:NOT\_FOUND

- PUBSUB:PERMISSION\_DENIED

- PUBSUB:RETRY\_EXHAUSTED

- PUBSUB:UNAVAILABLE

## Seek Messages

`<pubsub:seek-messages>`

Supports the bulk acknowledging or un-acknowledging of messages to a given snapshot or point of time
based on the provided seek target.

Seeking to a point in time marks every message received by Pub/Sub before the time as acknowledged,
and all messages received after the time as unacknowledged. You can replay and reprocess previously
acknowledged messages when seeking to a time in the past or purge messages when seeking to a time in
the future.

Seeking to a snapshot enables you to redeliver only the messages in the snapshot that match the
filter of the subscription making the seek request.

Once a snapshot is created, it retains all messages that were unacknowledged in the source
subscription at the time of the snapshot’s creation and any messages published to the topic
thereafter. You can replay these unacknowledged messages by using a snapshot to seek to any of the
topic’s subscriptions.

If you seek to a snapshot using a subscription with a filter, the Pub/Sub service redelivers only
the messages in the snapshot that match the filter of the subscription making the seek request.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Project ID</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project.</p></td><td></td><td></td></tr><tr><td><p>Subscription Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Project-wide unique identifier for the subscription.</p></td><td></td><td></td></tr><tr><td><p>Snapshot Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Snapshot to seek to. The snapshot’s topic must be the same as that of the provided subscription.</p></td><td></td><td></td></tr><tr><td><p>Timestamp</p></td><td><div><div><p>DateTime</p></div></div></td><td><p>Specific time to seek to. Messages retained in the subscription that were published before this time are marked as acknowledged, and messages retained in the subscription that were published after this time are marked as unacknowledged.</p><p><br></p><p>This operation affects only messages retained in the subscription (configured by the combination of <strong>Message Retention Duration</strong> and <strong>Retain Acked Messages</strong>). For example, if the time corresponds to a point before the message retention window (or to a point before the system’s notion of the subscription creation time), only retained messages are marked as unacknowledged, and already-expunged messages are not restored.</p><p><br></p><p>A timestamp is in RFC3339 UTC Zulu format, with nanosecond resolution and up to nine fractional digits, such as 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.</p></td><td></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

### Throws

- PUBSUB:BAD\_GATEWAY

- PUBSUB:CANCELLED

- PUBSUB:CONNECTIVITY

- PUBSUB:DEADLINE\_EXCEEDED

- PUBSUB:FAILED\_PRECONDITION

- PUBSUB:INVALID\_ARGUMENT

- PUBSUB:NOT\_FOUND

- PUBSUB:PERMISSION\_DENIED

- PUBSUB:RETRY\_EXHAUSTED

- PUBSUB:UNAVAILABLE

## Sources

## On message listener

`<pubsub:message-listener>`

Asynchronous message listener that consumes messages from one subscriber.

### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Configuration</p></td><td><p>String</p></td><td><p>Name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Consumer count</p></td><td><div><div><p>Number</p></div></div></td><td><p>Provides a specified amount of executor service for processing messages.</p></td><td><p>5</p></td><td></td></tr><tr><td><p>Config Ref</p></td><td><div><div><p>ConfigurationProvider</p></div></div></td><td><p>Name of the configuration used to execute this component.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Primary Node Only</p></td><td><div><div><p>Boolean</p></div></div></td><td><p>Determines whether to execute this source on only the primary node when running Mule instances in a cluster.</p></td><td></td><td></td></tr><tr><td><p>On Capacity Overload</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>WAIT</p></li><li><p>DROP</p></li><li><p>FAIL</p></li></ul></div></div></td><td><p>Strategy that the runtime applies when the flow receives more messages than it has the capacity to handle.</p></td><td><p>WAIT</p></td><td></td></tr><tr><td><p>Streaming Strategy</p></td><td><div><div><ul><li><p><a href="#RepeatableInMemoryStream">Repeatable In Memory Stream</a></p></li><li><p><a href="#RepeatableFileStoreStream">Repeatable File Store Stream</a></p></li><li><p>non-repeatable-stream</p></li></ul></div></div></td><td><p>Configures how Mule processes streams. The default is to use repeatable streams.</p></td><td></td><td></td></tr><tr><td><p>Redelivery Policy</p></td><td><div><div><p><a href="#RedeliveryPolicy">Redelivery Policy</a></p></div></div></td><td><p>Defines a policy for processing the redelivery of the same message.</p></td><td></td><td></td></tr><tr><td><p>Project ID</p></td><td><div><div><p>String</p></div></div></td><td><p>Globally unique identifier for your project.</p></td><td></td><td></td></tr><tr><td><p>Subscription Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Project-wide unique identifier for the subscription.</p></td><td></td><td></td></tr><tr><td><p>Limit Exceeded Behavior</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>THROW_EXCEPTION</p></li><li><p>BLOCK</p></li><li><p>IGNORE</p></li></ul></div></div></td><td><div><div><p>If not set to <code>IGNORE</code>, flow control enables you to control the publishing behavior by specifying limits for <strong>Max Outstanding Request Size</strong> and <strong>Max Outstanding Element Count</strong>.</p></div><div><ul><li><p><code>THROW_EXCEPTION</code></p><div><p>If the memory size or the amount of outstanding elements (messages where no Ack() or Nack() was performed) exceeds the specified limits, the receiver throws a <code>FlowControlException</code>.</p></div></li><li><p><code>BLOCK</code></p><div><p>If the memory size or the amount of outstanding elements (messages where no Ack() or Nack() was performed) exceeds the specified limits, the receiver does not receive more messages.</p></div></li><li><p><code>IGNORE</code></p><div><p>The receiver does not account for specified limits and does not control the message delivery rate.</p></div></li></ul></div></div></td><td></td><td></td></tr><tr><td><p>Max Outstanding Request Size</p></td><td><div><div><p>Number</p></div></div></td><td><p>Maximum amount of memory accumulated by the request before enforcing flow control.</p></td><td><p>100</p></td><td></td></tr><tr><td><p>Max Outstanding Request Size Unit</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>BYTE</p></li><li><p>KB</p></li><li><p>MB</p></li><li><p>GB</p></li></ul></div></div></td><td><p>Data unit for the <strong>Max Outstanding Request Size</strong> field.</p></td><td><p>MB</p></td><td></td></tr><tr><td><p>Max Outstanding Element Count</p></td><td><div><div><p>Number</p></div></div></td><td><p>Maximum number of outstanding elements to keep in the memory before enforcing flow control.</p></td><td><p>100</p></td><td></td></tr><tr><td><p>Reconnection Strategy</p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>Retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

### Output

<table><colgroup><col> <col></colgroup><tbody><tr><td><p>Type</p></td><td><p>Any</p></td></tr><tr><td><p>Attributes Type</p></td><td><div><div><p>Object</p></div></div></td></tr></tbody></table>

### For Configurations

- [Configuration](#Config)

## Types

### Reconnection

Configures a reconnection strategy for an operation.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Fails Deployment</strong></p></td><td><div><div><p>Boolean</p></div></div></td><td><div><div><p>What to do if, when an app is deployed, a connectivity test does not pass after exhausting the associated reconnection strategy:</p></div><div><ul><li><p><code>true</code></p><div><p>Allow the deployment to fail.</p></div></li><li><p><code>false</code></p><div><p>Ignore the results of the connectivity test.</p></div></li></ul></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Reconnection Strategy</strong></p></td><td><div><div><ul><li><p><a href="#Reconnect">Reconnect</a></p></li><li><p><a href="#ReconnectForever">Reconnect Forever</a></p></li></ul></div></div></td><td><div><div><p>Reconnection strategy to use.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Reconnect

Configures a standard reconnection strategy, which specifies how often to reconnect and how many
reconnection attempts the connector source or operation can make.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Frequency</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>How often to attempt to reconnect, in milliseconds.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Blocking</strong></p></td><td><div><div><p>Boolean</p></div></div></td><td><div><div><p>If <code>false</code>, the reconnection strategy will run in a separate, non-blocking thread.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Count</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>How many reconnection attempts the Mule app can make.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Reconnect Forever

Configures a forever reconnection strategy by which the connector source or operation attempts to
reconnect at a specified frequency for as long as the Mule app runs.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Frequency</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>How often to attempt to reconnect, in milliseconds.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Blocking</strong></p></td><td><div><div><p>Boolean</p></div></div></td><td><div><div><p>If <code>false</code>, the reconnection strategy will run in a separate, non-blocking thread.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Expiration Policy

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Max Idle Time</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>Configures the maximum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Time Unit</strong></p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>NANOSECONDS</p></li><li><p>MICROSECONDS</p></li><li><p>MILLISECONDS</p></li><li><p>SECONDS</p></li><li><p>MINUTES</p></li><li><p>HOURS</p></li><li><p>DAYS</p></li></ul></div></div></td><td><div><div><p>Time unit for the <strong>Max Idle Time</strong> field.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Repeatable In Memory Stream

Configures the in-memory streaming strategy by which the request fails if the data exceeds the MAX
buffer size. Always run performance tests to find the optimal buffer size for your specific use
case.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Initial Buffer Size</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>Initial amount of memory to allocate to the data stream. If the streamed data exceeds this value, the buffer expands by <strong>Buffer Size Increment</strong>, with an upper limit of <strong>Max In Memory Size value</strong>.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Buffer Size Increment</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>Amount by which the buffer size expands if it exceeds its initial size. Setting a value of <code>0</code> or lower specifies that the buffer can’t expand.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Max Buffer Size</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>Maximum size of the buffer. If the buffer size exceeds this value, Mule raises a <code>STREAM_MAXIMUM_SIZE_EXCEEDED</code> error. A value of less than or equal to <code>0</code> means no limit.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Buffer Unit</strong></p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>BYTE</p></li><li><p>KB</p></li><li><p>MB</p></li><li><p>GB</p></li></ul></div></div></td><td><div><div><p>Unit for the <strong>Initial Buffer Size</strong>, <strong>Buffer Size Increment</strong>, and <strong>Buffer Unit</strong> fields.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Repeatable File Store Stream

Configures the repeatable file-store streaming strategy by which Mule keeps a portion of the stream
content in memory. If the stream content is larger than the configured buffer size, Mule backs up
the buffer’s content to disk and then clears the memory.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>In Memory Size</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>Maximum amount of memory that the stream can use for data. If the amount of memory exceeds this value, Mule buffers the content to disk. To optimize performance:</p></div><div><ul><li><p>Configure a larger buffer size to avoid the number of times Mule needs to write the buffer on disk. This increases performance, but it also limits the number of concurrent requests your application can process, because it requires additional memory.</p></li><li><p>Configure a smaller buffer size to decrease memory load at the expense of response time.</p></li></ul></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Buffer Unit</strong></p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>BYTE</p></li><li><p>KB</p></li><li><p>MB</p></li><li><p>GB</p></li></ul></div></div></td><td><div><div><p>Unit for the <strong>In Memory Size</strong> field.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Redelivery Policy

Configures the redelivery policy for executing requests that generate errors. You can add a
redelivery policy to any source in a flow.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Max Redelivery Count</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>Maximum number of times that a redelivered request can be processed unsuccessfully before returning a REDELIVERY_EXHAUSTED error.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Message Digest Algorithm</strong></p></td><td><div><div><p>String</p></div></div></td><td><div><div><p>Secure hashing algorithm to use if the <strong>Use Secure Hash</strong> field is <code>true</code>. If the payload of the message is a Java object, Mule ignores this value and returns the value that the payload’s <code>hashCode()</code> returned.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Message Identifier</strong></p></td><td><div><div><p><a href="#RedeliveryPolicyMessageIdentifier">Redelivery Policy Message Identifier</a></p></div></div></td><td><div><div><p>Defines which strategy is used to identify the messages.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Object Store</strong></p></td><td><div><div><p>ObjectStore</p></div></div></td><td><div><div><p>Configures the object store that stores the redelivery counter for each message.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Redelivery Policy Message Identifier

Configures how to identify a redelivered message and how to find out when the message was
redelivered.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Use Secure Hash</strong></p></td><td><div><div><p>Boolean</p></div></div></td><td><div><div><p>If <code>true</code>, Mule uses a secure hash algorithm to identify a redelivered message.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Id Expression</strong></p></td><td><div><div><p>String</p></div></div></td><td><div><div><p>One or more expressions that determine when a message was redelivered. You can set this property only if the <strong>Use Secure Hash</strong> field is <code>false</code>.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Snapshot

Snapshot resource. You can use snapshots in seek operations, which manage message acknowledgments in
bulk. This type enables you to set the acknowledgment state of messages in an existing subscription
to the state captured by a snapshot.

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Name</strong></p></td><td><div><div><p>String</p></div></div></td><td><div><div><p>Name of the snapshot.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Topic</strong></p></td><td><div><div><p>String</p></div></div></td><td><div><div><p>Name of the topic from which the snapshot retains messages.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Expire Time</strong></p></td><td><div><div><p>DateTime</p></div></div></td><td><div><div><p>Time length for which the snapshot is guaranteed to exist. The lifetime for a newly-created snapshot is based on the oldest unacked message in the source subscription’s backlog, however, the snapshot can exist for a maximum of seven days.</p></div><div><p><br></p></div><div><p>Consider a subscription with an oldest unacked message that is three days old. If a snapshot is created from this subscription, the snapshot will expire in four days. The service will refuse to create a snapshot that will expire in less than one hour after creation.</p></div><div><p><br></p></div><div><p>A timestamp is in RFC3339 UTC Zulu format, with nanosecond resolution and up to nine fractional digits, such as 2014-10-02T15:01:23Z and 2014-10-02T15:01:23.045123456Z.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Labels</strong></p></td><td><div><div><p>Any</p></div></div></td><td><div><div><p>Object containing a list of key-value pairs, such as { "name": "wrench", "mass": "1.3kg", "count": "3" }.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Repeatable In Memory Iterable

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>Initial Buffer Size</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>The number of instances to initially keep in memory to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then the buffer expands according to the <strong>Buffer Size Increment</strong> field, with an upper limit of <strong>Max In Memory Size</strong>.</p></div></div></td><td><div><div><p>100</p></div></div></td><td><div></div></td></tr><tr><td><p><strong>Buffer Size Increment</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised when the buffer gets full.</p></div></div></td><td><div><div><p>100</p></div></div></td><td><div></div></td></tr><tr><td><p><strong>Max Buffer Size</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>The maximum amount of memory to use. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error is raised. A value lower than or equal to zero means no limit.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

### Repeatable File Store Iterable

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p><strong>In Memory Objects</strong></p></td><td><div><div><p>Number</p></div></div></td><td><div><div><p>The maximum amount of instances to keep in memory. If more than that is required, content on the disk is buffered.</p></div></div></td><td><div></div></td><td><div></div></td></tr><tr><td><p><strong>Buffer Unit</strong></p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>BYTE</p></li><li><p>KB</p></li><li><p>MB</p></li><li><p>GB</p></li></ul></div></div></td><td><div><div><p>Unit for the <strong>In Memory Objects</strong> field.</p></div></div></td><td><div></div></td><td><div></div></td></tr></tbody></table>

## See Also

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Salesforce Help](https://help.salesforce.com)
