MSMQ - Create Queue
Declaration
<AMMSMQ TRANSACTIONAL="YES/NO" NAME="text" RESULTDATASET="text" REMOTEMACHINE="text" />
Description: Creates a public or private queue on the local remote computer based on the queue properties provided and populates a dataset with information about the newly created queue.
Practical Usage
Creates a message queue to perform subsequent MSMQ transactions.
Queue Parameters
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) |
|
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. |
Name |
Text |
Yes |
(Empty) |
QUEUENAME="CompName\QueueName" |
The name of the message queue to create. The message queue name consists of the compute name, an optional PRIVATE$ keyword that indicates whether it is a private queue and the name of the queue. Public queue example: ComputerName\QueueName Private queue example: ComputerName\PRIVATE$\QueueName |
Private |
Yes/No |
No |
No |
PRIVATE="YES" |
If set to YES, specifies that the newly created queue should be set as private. A private queue is a queue registered on the local machine (not in the directory service) that typically cannot be located by other applications. Private queues have the advantage of no directory service overhead (no latency, and no replication), and they can be created and deleted when the directory service is not working. This parameter is set to NO by default and available only if the Local computer parameter is enabled. |
Transactional |
Yes/No |
No |
No |
TRANSACTIONAL="YES" |
If set to YES, specifies that the newly created queue should be set as transactional. Transactional queues can only contain transactional messages, which are messages sent within a transaction. This parameter is set to NO by default. |
Create and populate dataset with queue information |
Text |
Yes |
(Empty) |
RESULTDATASET="theQueueInfo" |
The dataset name to be created and populated with information regarding the newly created queue. More information regarding this parameter and related dataset fields can be found below under Datasets. |
Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.
Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)
On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)
Datasets
A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields. The table below describes these fields (assuming the dataset name assigned was theDataset).
Name |
Type |
Return Value |
---|---|---|
theDataset.QueuePath |
Text |
Returns the path to the newly created queue. |
theDataset.ID |
Text |
Returns the unique ID for the queue. |
Example
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Description: A simple task that creates a queue, sends a message to that queue, waits for the message, retrieves the message and purges the queue. Step by step details are embedded in the task.
<!-- Create variable --> <AMVARIABLE NAME="theVar" /> <!-- Create private queue --> <AMMSMQ PRIVATE="YES" NAME="myPrivateQueue" RESULTDATASET="privateQueueData" /> <!-- Send message to queue --> <AMMSMQ ACTIVITY="send_message" QUEUENAME="vmwinvx64\Private$\myPrivateQueue" MESSAGELABEL="Support" MESSAGEFILE="C:\Users\techsupport\Desktop\cd.txt" /> <!-- Wait for message --> <AMMSMQ ACTIVITY="wait_for_message" QUEUENAME="vmwinvx64\Private$\myPrivateQueue" RESULTDATASET="data" MESSAGELABEL="Support" RESULTVARIABLE="theVar" /> <!-- Retrieve message --> <AMMSMQ ACTIVITY="retrieve_message" QUEUENAME="vmwinvx64\Private$\myPrivateQueue" RESULTDATASET="data" MESSAGEFILE="C:\Users\techsupport\Desktop\rt.txt" OVERWRITEFILE="YES" REMOVEMESSAGE="YES" /> <!-- Purge queue --> <AMMSMQ ACTIVITY="delete_queue" QUEUENAME="vmwinvx64\Private$\myPrivateQueue" />