You create a queue to provide a resource with which your messaging components can interact. For example, suppose you are building an order entry system that places orders into queues as they are received from the sales force or from direct customer interaction on a Web site. You might begin by creating an OrderEntry queue on your Message Queuing enterprise. All of the components you create to process orders will interact with this queue.
You can create a queue by using the Create constructor from your code. You can use the Windows 2000 Computer Management window to verify that your queue has been created successfully.
You can create a public queue on your own computer or any Message Queuing computer to which you have domain or enterprise administrative access rights. You can also create private queues on your local computer only. For more information on access rights, see Message Queue Security, or see "Access Control for Message Queuing" in the documentation for the Computer Management dialog box.
Note It is important to note the difference between creating a queue and creating an instance of the MessageQueue component. When you use the Create constructor, you are creating a new queue in the Message Queuing network, rather than a component in your project or application. When you create an instance of the MessageQueue component, you create a component inside your project that references an external queue.
You can also configure an installation component to create or locate an existing queue when your application is deployed. For more information, see Custom Actions Management in Deployment.
To create a public queue programmatically
[Visual Basic] MessageQueue.Create("myMachine\MyQueue") [C#] MessageQueue.Create (@"myMachine\MyQueue");
To create a private queue programmatically
[Visual Basic] MessageQueue.Create("myMachine\Private$\MyPrivateQueue") [C#] MessageQueue.Create (@"myMachine\Private$\MyPrivateQueue");
To verify that your message queue was created
You can use the Windows 2000 Computer Management window to verify that your message queue was created.
Creating, Deleting, and Administering Queues | Creating MessageQueue Components