Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

VM Connector Documentation Reference

The VM Connector is used for intra/inter app communication. The communication is done through asynchronous queues, which can be either transient or persistent. Transient queues are faster, but not reliable in the case of a system crash. 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 into disk. When running in cluster mode, persistent queues are backed by the memory grid instead. This means that when a flow uses the VM connector to publish content to a queue, the Runtime will decide whether to process that message in the same origin node or to send it out to the cluster for another node to pick it up. This is an easy way to distribute load across the cluster. In either way, transactions are always supported. Each config defines its own set of queues. Those queues are only visible to components referencing that config.

Configurations


Config

Default configuration

Parameters

Name Type Description Default Value Required

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x 

Connection

The connection types that can be provided to this configuration.

x 

Queues

Array of Queue

The queues that this config owns

x 

Connection Types

Connection

Returns instances of VMConnection

Parameters
Name Type Description Default Value Required

Reconnection

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn't pass after exhausting the associated reconnection strategy

 

Associated Operations

Associated Sources

Operations

Consume

<vm:consume>

Pull one message from a queue. If a message is not immediately available, it will wait up to the configured queueTimeout, after which a VM:QUEUE_TIMEOUT error will be thrown.

The queue on which the content is published has to be one for which a doesn't exists. Consuming from queues on which a exists is not allowed.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

The type of joining action that operations can take regarding transactions.

JOIN_IF_POSSIBLE

 

Queue Name

String

The name of the queue

x 

Timeout

Number

How long to wait on the queue to complete and operation (either publishing or consuming) before failing with a timeout error

5

 

Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A TimeUnit which qualifies the #timeoutUnit

SECONDS

 

Target Variable

String

The name of a variable on which the operation's output will be placed

 

Target Value

String

An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable

#[payload]

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

Output

Type

Any

Attributes Type

For Configurations.

Throws

  • VM:EMPTY_QUEUE  

  • VM:RETRY_EXHAUSTED  

  • VM:CONNECTIVITY  

Publish

<vm:publish>

Publishes the given content into the queue of the given queueName.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Content

Any

the content to be published

#[payload]

 

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

The type of joining action that operations can take regarding transactions.

JOIN_IF_POSSIBLE

 

Queue Name

String

The name of the queue

x 

Timeout

Number

How long to wait on the queue to complete and operation (either publishing or consuming) before failing with a timeout error

5

 

Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A TimeUnit which qualifies the #timeoutUnit

SECONDS

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

For Configurations.

Throws

  • VM:RETRY_EXHAUSTED  

  • VM:QUEUE_TIMEOUT  

  • VM:CONNECTIVITY  

Publish Consume

<vm:publish-consume>

Publishes the given content into a queue, and then awaits up to the queueTimeout for a response to be supplied on a temporal reply-To queue that this operation automatically creates.

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

The queue on which the content is published has to be one for which a doesn't exists. Consuming from queues on which a exists is not allowed.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Content

Any

the content to be published

#[payload]

 

Transactional Action

Enumeration, one of:

  • ALWAYS_JOIN

  • JOIN_IF_POSSIBLE

  • NOT_SUPPORTED

The type of joining action that operations can take regarding transactions.

JOIN_IF_POSSIBLE

 

Queue Name

String

The name of the queue

x 

Timeout

Number

How long to wait on the queue to complete and operation (either publishing or consuming) before failing with a timeout error

5

 

Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A TimeUnit which qualifies the #timeoutUnit

SECONDS

 

Target Variable

String

The name of a variable on which the operation's output will be placed

 

Target Value

String

An expression that will be evaluated against the operation's output and the outcome of that expression will be stored in the target variable

#[payload]

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

Output

Type

Any

Attributes Type

For Configurations.

Throws

  • VM:RETRY_EXHAUSTED  

  • VM:QUEUE_TIMEOUT  

  • VM:CONNECTIVITY  

Sources

Listener

<vm:listener>

A source which creates and listens on a VM queues.

VM queues are created by placing listeners on them, which is why this listener contains parameters on the queue's behaviour, such as it being persistent or not, the max capacity, etc.

Parameters

Name Type Description Default Value Required

Configuration

String

The name of the configuration to use.

x 

Number Of Consumers

Number

The amount of concurrent consumers to be placed on the queue. As the number of consumers increases, so does the speed on which this source pushes messages into the owning flow.

4

 

Transactional Action

Enumeration, one of:

  • ALWAYS_BEGIN

  • NONE

The type of beginning action that sources can take regarding transactions.

NONE

 

Transaction Type

Enumeration, one of:

  • LOCAL

  • XA

The type of transaction to create. Availability will depend on the runtime version.

LOCAL

 

Redelivery Policy

Defines a policy for processing the redelivery of the same message

 

Queue Name

String

The name of the queue

x 

Timeout

Number

How long to wait on the queue to complete and operation (either publishing or consuming) before failing with a timeout error

5

 

Timeout Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A TimeUnit which qualifies the #timeoutUnit

SECONDS

 

Reconnection Strategy

A retry strategy in case of connectivity errors

 

Content

Any

#[payload]

 

Output

Type

Any

Attributes Type

For Configurations.

Types

Reconnection

Field Type Description Default Value Required

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn’t pass after exhausting the associated reconnection strategy

Reconnection Strategy

The reconnection strategy to use

Reconnect

Field Type Description Default Value Required

Frequency

Number

How often (in ms) to reconnect

Count

Number

How many reconnection attempts to make

Reconnect Forever

Field Type Description Default Value Required

Frequency

Number

How often (in ms) to reconnect

Queue

Field Type Description Default Value Required

Queue Name

String

x

Queue Type

Enumeration, one of:

  • TRANSIENT

  • PERSISTENT

TRANSIENT

Max Outstanding Messages

Number

0

VM Message Attributes

Field Type Description Default Value Required

Queue Name

String

Timestamp

DateTime

Redelivery Policy

Field Type Description Default Value Required

Max Redelivery Count

Number

The maximum number of times a message can be redelivered and processed unsuccessfully before triggering process-failed-message

Use Secure Hash

Boolean

Whether to use a secure hash algorithm to identify a redelivered message

Message Digest Algorithm

String

The secure hashing algorithm to use. If not set, the default is SHA-256.

Id Expression

String

Defines one or more expressions to use to determine when a message has been redelivered. This property may only be set if useSecureHash is false.

Object Store

The object store where the redelivery counter for each message is going to be stored.