---
schema_version: "1"
id: 4682436c3d816bf3d46ce16eb97c99da32a0f46ec46c7afa0028498a71fa4eff
title: VM Connector Reference
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/vm-connector/latest/vm-reference.md
canonical_url: https://docs.mulesoft.com/vm-connector/latest/vm-reference
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6b0f35cd3dd70c5d2206685c31d5cd01a3f81bc8443c12fc5640e4256e0dbae6
description: MuleSoft Documentation Site
release: "2.0"
latest: true
---
---
product: VM Connector
version: 2.0
is-latest-version: true
---

# VM Connector Reference

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

VM Connector v2.0

Anypoint Connector for Virtual Machine (VM) (VM Connector) provides intra-app and inter-app
communication through transient or persistent asynchronous queues. Transient queues are faster, but
not as reliable as persistent queues if the system crashes. Persistent queues, on the other hand,
are slower but reliable.

When running on a single instance, persistent queues work by serializing and storing the contents on
to disk. When running in cluster mode, persistent queues are instead backed by the memory grid. This
means that when a Mule flow uses VM Connector to publish content to a queue, Mule runtime engine
(Mule) decides whether to process that message in the same origin node or to send it out to the
cluster to be picked up and processed by another node. This is an easy way to distribute load across
the cluster and ensure that transactions are always supported.

Each configuration defines its own set of queues, which are visible only to components referencing
that configuration.

Release Notes: [VM Connector Release Notes](https://docs.mulesoft.com/release-notes/connector/connector-vm)

## Configurations

---

### Default Configuration

These are the parameters for the default 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>The 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">Connection</a></p></div></div></td><td><p>The connection types that can be provided to this configuration.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Queues</p></td><td><div><div><p>Array of <a href="#queue">Queue</a></p></div></div></td><td><p>The queues that this configuration owns.</p></td><td></td><td><p>x</p></td></tr></tbody></table>

#### Connection Types

##### Connection

Returns instances of VMConnection.

###### 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>Reconnection</p></td><td><div><div><p><a href="#Reconnection">Reconnection</a></p></div></div></td><td><p>When the application is deployed, a connectivity test is performed on all connectors. If set to <code>true</code>, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.</p></td><td></td><td></td></tr></tbody></table>

## Associated Operations

- [Consume](#consume)

- [Publish](#publish)

- [Publish Consume](#publishConsume)

## Associated Sources

- [Listener](#listener)

## Operations

### Consume

`<vm:consume>`

This operation pulls a message from a queue. If a message is not immediately available, the Consume
operation waits for up to the configured `queueTimeout` value, after which a `VM:QUEUE_TIMEOUT`
error is thrown.

The flow in which the content is consumed cannot contain a Listener (`<vm:listener>`) source.

#### 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>The name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Transactional Action</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>ALWAYS_JOIN: The current operation joins to the current transactions. If a transaction doesn’t exist or is not compatible with the operation, the execution fails.</p></li><li><p>JOIN_IF_POSSIBLE: The current operation joins to available transactions. If there is no transaction to join, the current operation executes outside of existing transactions.</p></li><li><p>NOT_SUPPORTED: The current operation executes outside of existing transactions.</p></li></ul></div></div></td><td><p>The type of joining action that operations can take regarding transactions.</p></td><td><p>JOIN_IF_POSSIBLE</p></td><td></td></tr><tr><td><p>Queue Name</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of the queue.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Timeout</p></td><td><div><div><p>Number</p></div></div></td><td><p>How long to wait for the queue to complete an operation (either publishing or consuming) before failing with a timeout error. The default is 5 seconds.</p></td><td><p>5</p></td><td></td></tr><tr><td><p>Timeout 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>A TimeUnit that qualifies the #timeoutUnit</p></td><td><p>SECONDS</p></td><td></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of a variable in which the operation’s output is placed.</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>An expression that evaluates against the operations’s output. The outcome of this expression is stored in the target variable.</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="#reconnect-forever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>A 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><strong>Type</strong></p></td><td><div><div><p>Any</p></div></div></td></tr><tr><td><p><strong>Attributes Type</strong></p></td><td><div><div><p><a href="#VMMessageAttributes">VM Message Attributes</a></p></div></div></td></tr></tbody></table>

#### For Configurations

- [Default Configuration](#config)

#### Throws

- VM:EMPTY\_QUEUE

- VM:RETRY\_EXHAUSTED

- VM:CONNECTIVITY

### Publish

`<vm:publish>`

This operation publishes the given content into the queue of the given queue name.

#### 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>The name of the configuration to use.</p></td><td></td><td><p><strong>x</strong></p></td></tr><tr><td><p>Content</p></td><td><div><div><p>Any</p></div></div></td><td><p>The content to be published.</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Transactional Action</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>ALWAYS_JOIN: The current operation joins to the current transactions. If a transaction doesn’t exist or is not compatible with the operation, the execution fails.</p></li><li><p>JOIN_IF_POSSIBLE: The current operation joins to available transactions. If there is no transaction to join, the current operation executes outside of existing transactions.</p></li><li><p>NOT_SUPPORTED: The current operation executes outside of existing transactions.</p></li></ul></div></div></td><td><p>The type of joining action that operations can take regarding transactions.</p></td><td><p>JOIN_IF_POSSIBLE</p></td><td></td></tr><tr><td><p>Queue Name</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of the queue</p></td><td></td><td><p><strong>x</strong></p></td></tr><tr><td><p>Timeout</p></td><td><div><div><p>Number</p></div></div></td><td><p>How long to wait for the queue to complete an operation (either publishing or consuming) before failing with a timeout error. The default is 5 seconds.</p></td><td><p>5</p></td><td></td></tr><tr><td><p>Timeout 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>A TimeUnit that qualifies the #timeoutUnit.</p></td><td><p>SECONDS</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="#reconnect-forever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>A retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr></tbody></table>

#### For Configurations

- [Default Configuration](#config)

#### Throws

- VM:RETRY\_EXHAUSTED

- VM:QUEUE\_TIMEOUT

- VM:CONNECTIVITY

### Publish Consume

`<vm:publish-consume>`

This operation publishes the provided content into a queue, and then waits up to the time configured
in `queueTimeout` for a response to be supplied on a temporal reply-To queue that this operation
creates automatically.

The temporal reply-To queue is automatically disposed of after a response is received or the timeout
expires.

The flow in which the content is published cannot contain a Listener (`<vm:listener>`) source.

#### 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>The name of the configuration to use.</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Content</p></td><td><div><div><p>Any</p></div></div></td><td><p>The content to be published</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Transactional Action</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>ALWAYS_JOIN: The current operation joins to the current transactions. If a transaction doesn’t exist or is not compatible with the operation, the execution fails.</p></li><li><p>JOIN_IF_POSSIBLE: The current operation joins to available transactions. If there is no transaction to join, the current operation executes outside of existing transactions.</p></li><li><p>NOT_SUPPORTED: The current operation executes outside of existing transactions.</p></li></ul></div></div></td><td><p>The type of joining action that operations can take regarding transactions.</p></td><td><p>JOIN_IF_POSSIBLE</p></td><td></td></tr><tr><td><p>Queue Name</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of the queue</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Timeout</p></td><td><div><div><p>Number</p></div></div></td><td><p>How long to wait for the queue to complete an operation (either publishing or consuming) before failing with a timeout error. The default is 5 seconds.</p></td><td><p>5</p></td><td></td></tr><tr><td><p>Timeout 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>A TimeUnit that qualifies the #timeoutUnit</p></td><td><p>SECONDS</p></td><td></td></tr><tr><td><p>Target Variable</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of a variable in which the operation’s output is placed.</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>An expression to evaluate against the operation’s output and the outcome of that expression is stored in the target variable.</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="#reconnect-forever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>A 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><strong>Type</strong></p></td><td><div><div><p>Any</p></div></div></td></tr><tr><td><p><strong>Attributes Type</strong></p></td><td><div><div><p><a href="#VMMessageAttributes">VM Message Attributes</a></p></div></div></td></tr></tbody></table>

#### For Configurations

- [Default Configuration](#config)

#### Throws

- VM:RETRY\_EXHAUSTED

- VM:QUEUE\_TIMEOUT

- VM:CONNECTIVITY

## Sources

### Listener

`<vm:listener>`

A source that creates and listens on VM queues. VM queues are created by placing listeners on them,
which is why this listener contains parameters for a queue’s behavior, such as whether or not it is
persistent, the maximum capacity, and so on.

#### 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>The name of the configuration to use.</p></td><td></td><td><p><strong>x</strong></p></td></tr><tr><td><p>Number Of Consumers</p></td><td><div><div><p>Number</p></div></div></td><td><p>The number of concurrent consumers to place on the queue. As the number of consumers increases, so does the speed at which this source pushes messages into the owning flow. The default is 4 concurrent consumers.</p></td><td><p>4</p></td><td></td></tr><tr><td><p>Transactional Action</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>ALWAYS_BEGIN</p></li><li><p>NONE</p></li></ul></div></div></td><td><p>The type of beginning action that sources can take regarding transactions.</p></td><td><p>NONE</p></td><td></td></tr><tr><td><p>Transaction Type</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>LOCAL</p></li><li><p>XA</p></li></ul></div></div></td><td><p>The type of transaction to create. Availability depends on the Mule version.</p></td><td><p>LOCAL</p></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 a message.</p></td><td></td><td></td></tr><tr><td><p>Queue Name</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of the queue.</p></td><td></td><td><p><strong>x</strong></p></td></tr><tr><td><p>Timeout</p></td><td><div><div><p>Number</p></div></div></td><td><p>How long to wait for the queue to complete an operation (either publishing or consuming) before failing with a timeout error. The default is 5 seconds.</p></td><td><p><code>5</code></p></td><td></td></tr><tr><td><p>Timeout 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>A TimeUnit that qualifies the #timeoutUnit</p></td><td><p><code>SECONDS</code></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="#reconnect-forever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>A retry strategy in case of connectivity errors.</p></td><td></td><td></td></tr><tr><td><p>Content</p></td><td><div><div><p>Any</p></div></div></td><td></td><td><p>#[payload]</p></td><td></td></tr></tbody></table>

#### Output

<table><colgroup><col> <col></colgroup><tbody><tr><td><p><strong>Type</strong></p></td><td><div><div><p>Any</p></div></div></td></tr><tr><td><p><strong>Attributes Type</strong></p></td><td><div><div><p><a href="#VMMessageAttributes">VM Message Attributes</a></p></div></div></td></tr></tbody></table>

#### For Configurations

- [Default Configuration](#config)

## Types

### Reconnection

<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>Fails Deployment</p></td><td><div><div><p>Boolean</p></div></div></td><td><p>When the application is deployed, a connectivity test is performed on all connectors. If set to <code>true</code>, deployment fails if the test doesn’t pass after exhausting the associated reconnection strategy.</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="#reconnect-forever">Reconnect Forever</a></p></li></ul></div></div></td><td><p>The reconnection strategy to use.</p></td><td></td><td></td></tr></tbody></table>

### Reconnect

<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>Frequency</p></td><td><div><div><p>Number</p></div></div></td><td><p>How often in milliseconds to reconnect.</p></td><td></td><td></td></tr><tr><td><p>Count</p></td><td><div><div><p>Number</p></div></div></td><td><p>How many reconnection attempts to make.</p></td><td></td><td></td></tr><tr><td><p>blocking</p></td><td><p>Boolean</p></td><td><p>If <code>false</code>, the reconnection strategy runs in a separate, non-blocking thread.</p></td><td><p><code>true</code></p></td><td></td></tr></tbody></table>

### Reconnect Forever

<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>Frequency</p></td><td><div><div><p>Number</p></div></div></td><td><p>How often in milliseconds to reconnect.</p></td><td></td><td></td></tr><tr><td><p>blocking</p></td><td><p>Boolean</p></td><td><p>If <code>false</code>, the reconnection strategy runs in a separate, non-blocking thread.</p></td><td><p><code>true</code></p></td><td></td></tr></tbody></table>

### Queue

<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>Queue Name</p></td><td><div><div><p>String</p></div></div></td><td><p>The name of the queue</p></td><td></td><td><p>x</p></td></tr><tr><td><p>Queue Type</p></td><td><div><div><p>Enumeration, one of:</p></div><div><ul><li><p>TRANSIENT</p></li><li><p>PERSISTENT</p></li></ul></div></div></td><td><p>Specifies whether the queue is persistent or transient</p></td><td><p><code>TRANSIENT</code></p></td><td></td></tr><tr><td><p>Max Outstanding Messages</p></td><td><div><div><p>Number</p></div></div></td><td><p>Specifies the number of messages that can be queued before blocking starts. When the value is <code>0</code>, blocking starts immediately.</p></td><td><p><code>0</code></p></td><td></td></tr></tbody></table>

### VM Message Attributes

<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>Queue Name</p></td><td><div><div><p>String</p></div></div></td><td><p>Name of the queue the content came from.</p></td><td></td><td></td></tr><tr><td><p>Timestamp</p></td><td><div><div><p>DateTime</p></div></div></td><td><p>Time that the content was retrieved.</p></td><td></td><td></td></tr></tbody></table>

### Redelivery 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>Max Redelivery Count</p></td><td><div><div><p>Number</p></div></div></td><td><p>The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed message.</p></td><td></td><td></td></tr><tr><td><p>Use Secure Hash</p></td><td><div><div><p>Boolean</p></div></div></td><td><p>Whether to use a secure hash algorithm to identify a redelivered message.</p></td><td></td><td></td></tr><tr><td><p>Message Digest Algorithm</p></td><td><div><div><p>String</p></div></div></td><td><p>The secure hashing algorithm to use. If not set, the default is SHA-256.</p></td><td></td><td></td></tr><tr><td><p>Id Expression</p></td><td><div><div><p>String</p></div></div></td><td><p>Defines one or more expressions to use to determine when a message has been redelivered. This property can be set only if useSecureHash is <code>false</code>.</p></td><td></td><td></td></tr><tr><td><p>Object Store</p></td><td><div><div><p>ObjectStore</p></div></div></td><td><p>The object store where the redelivery counter for each message is stored.</p></td><td></td><td></td></tr></tbody></table>

## See Also

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