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). This is a visual mode parameter used only during design time, therefore, contains no markup.

Another computer

Text

No

(Empty)

  1. REMOTEMACHINE="CompName"

  2. REMOTEMACHINE="xxx.xxx.xxx.xxx

If enabled, specifies the host name 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:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

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" />