MSMQ - Queue exists
Declaration
<AMMSMQ ACTIVITY="queue_exist" QUEUE="text" REMOTEMACHINE="text" RESULTVARIABLE="text" />
Description
Determines whether a specific queue exists on the local computer or on a remote system and populates a variable with the result. If the queue exists, this activity returns TRUE. Otherwise, it returns FALSE.
Practical usage
Ideally used as a conditional step that can perform different actions depending on whether the condition results to TRUE or FALSE. For example, if this activity returns TRUE, execute steps to send messages to the existing queue. If FALSE, execute steps to create a new queue in which to store new messages.
Parameters
Queue
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Local computer | --- | --- | --- | --- | If
enabled, specifies that this activity will be performed on the
local computer (enabled by default). NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes. |
Another computer | Text | No | (Empty) |
|
If enabled, specifies the hostname or IP address of the remote computer that this activity will be performed on. When this parameter is enabled, the Local computer parameter is ignored. |
Queue path | Text | Yes | (Empty) | QUEUENAME="CompName\QueueName" | The
full path and name of the message queue. The message queue name
consists of the computer name, an optional PRIVATE$ keyword that
indicates whether it is a private queue and the name of the queue.
See examples below:
|
Populate automate variable with result | Yes/No | No | No | RESULTVARIABLE="theResult" | The name of the variable in which to populate with the results of this activity. |
Example
- Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
- To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.
Description
This sample task checks if a queue exists and then populates a dataset with the results.
<AMVARIABLE NAME="var_Queue" VALUE="" />
<AMMSMQ ACTIVITY="queue_exist" QUEUE="vmwinvx64\Private$\myPrivateQueue" RESULTVARIABLE="var_Queue" />