MSMQ - Queue exists

Declaration

<AMMSMQ ACTIVITY="queue_exist" QUEUE="text" REMOTEMACHINE="text" RESULTVARIABLE="text" />

Related Topics   

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.

IMPORTANT: MSMQ must be installed on the (local or remote) computer in order for these activities to function properly. MSMQ is bundled with most Microsoft Windows operating systems, however, it is not installed by default. For more details regarding the installation of MSMQ, see MSMQ Installation & Overview.

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)
  • REMOTEMACHINE="CompName"
  • REMOTEMACHINE="xxx.xxx.xxx.xxx"
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:
  • Public queue sample: ComputerName\QueueName
  • Private queue sample: ComputerName\PRIVATE$\QueueName
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.

Description

Error Causes

On Error

Example

NOTE:
  • 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.

Copy
<AMVARIABLE NAME="var_Queue" VALUE="" />
<AMMSMQ ACTIVITY="queue_exist" QUEUE="vmwinvx64\Private$\myPrivateQueue" RESULTVARIABLE="var_Queue" />