MSMQ - Create Queue

Declaration

<AMMSMQ REMOTEMACHINE="text" QUEUENAME="text" TRANSACTIONAL="YES/NO" RESULTDATASET="text (dataset name)" />

See Also

MSMQ - Delete Queue | MSMQ - Retrieve Message | MSMQ - Send Message | MSMQ - Wait for Message | MSMQ - Clear Queue

Description

Creates a message queue with the specified name on the local or remote machine and populates a dataset with information about the newly created queue.

IMPORTANT: MSMQ must be installed on the (local or remote) system in order for these activities to function properly. MSMQ is bundled with Microsoft Windows 2000, Windows XP (excluding Home Edition), Windows Server 2003, Windows Vista and Windows 7 operating systems, however, they are not installed by default. For more details regarding the installation of MSMQ, see MSMQ Installation & Overview.

Practical Usage

Creates a message queue in order to perform other MSMQ transactions.

Parameters

General Properties

Property

Type

Required

Default

Markup

Description

Local Machine

 

 

 

 

If enabled, specifies that this activity will be performed on the local machine. If selected, the Remote Machine parameter is ignored. This parameter is enabled by default.

Remote Machine

Text

No

(Empty)

REMOTEMACHINE="ComputerName"

If enabled, specifies the host name or IP address of the remote machine that this activity will be performed on. If this parameter is enabled, the Local Machine parameter is ignored.

Queue 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. This parameter is set to NO by default and available only if the Local Machine parameter is enabled.

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.

Transactional

Yes/No

No

No

TRANSACTIONAL="YES"

If set to YES, specifies that the newly created queue should be set as transactional. This parameter is set to NO by default.

Transactional queues can only contain transactional messages, which are messages sent within a transaction.

Populate queue information in dataset

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 Notes.

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab allows you to select/omit specific errors that should cause a particular step to fail.

More on Error Causes properties

On Error Properties

The On Error tab allows you to determine what the task should do if a particular step encounters an error.

More about On Error properties

Notes

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.

 

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (Example: %myVariable% or %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by clicking the Insert expression/variable button or pressing F2.

More on variables
More on expressions

More on the Expression Builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Description: This sample code creates a private queue named "myQueue" on the local machine. Queue information is stored in a dataset named "myDataset".

 

<AMMSMQ QUEUENAME="myQueue" PRIVATE="YES" RESULTDATASET="myDataset" />

 

↑ Top of Page