Creating Queue Examples
Updated: July 19, 2016
Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista
To create a queue, you need to set the path name property of the queue, set any optional queue properties to define the queue's behavior (such as the label property of the queue, and then make the call to create the queue.
The path name of the queue includes the following information.
The computer where the messages of the queue will be stored (for private queues this is the computer where the queue is registered.
An optional PRIVATE$ keyword that indicates that the queue is a private queue (if this keyword is not included Message Queuing creates a public queue).
A user friendly name for the queue.
For a complete description of path names, see Queue Path Names.
Message Queuing registers public queues in the directory service and private queues on a specific computer.
When a public queue is created, its name, property settings, security descriptor, and the name of the computer where the queue's messages will be stored are all registered in the directory service.
When a private queue is created, its name, property settings, and security descriptor are all registered on the computer specified in the queue's path name.
Creating transactional and nontransactional queues is very similar. The only difference is the setting of the transactional level property for the queue. However, this done differently depending on the development language being used. Examples of creating transactional and nontransactional messages are provided in the list below.
For code examples for creating various sorts of queues, see the following language-specific examples.