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.
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 |
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 vm:listener exists. Otherwise, a VM:QUEUE_NOT_FOUND error is thrown.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Transactional Action |
Enumeration, one of:
|
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:
|
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:QUEUE_NOT_FOUND
-
VM:CONNECTIVITY
Publish
<vm:publish>
Publishes the given content into the queue of the given queueName.
The queue on which the content is published has to be one for which a vm:listener exists. Otherwise, a VM:QUEUE_NOT_FOUND error is thrown.
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:
|
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:
|
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:QUEUE_NOT_FOUND
-
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 vm:listener exists. Otherwise, a VM:QUEUE_NOT_FOUND error is thrown.
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:
|
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:
|
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:QUEUE_NOT_FOUND
-
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.
The VM connector can only be used to publish and consume messages from queues for which a listener has been defined.
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:
|
The type of beginning action that sources can take regarding transactions. |
NONE |
|
Transaction Type |
Enumeration, one of:
|
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:
|
A TimeUnit which qualifies the #timeoutUnit |
SECONDS |
|
Queue Type |
Enumeration, one of:
|
Whether the queue is transient or persistent |
TRANSIENT |
|
Max Outstanding Messages |
Number |
Defines the maximum number of messages that can be queued. |
0 |
|
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 |
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. |