Accomplishing Tasks Using MSMQ and .NET

This section shows code snippets that accomplish the following tasks with MSMQ and .NET.

Creating Message Queues

Creating a message queue programmatically in ASP.NET is pretty straight forward; however, the most common practice for creating message queues is to use the MMC and create the queues through the MSMQ snap-in.

To create a public message queue:

01 Dim myMQ as New Messaging.MessageQueue 
02 MyMQ.Create ("inspiration\myPublicMessageQueue") 

To create a public message queue that is transactional:

01 Dim myMQ as New Messaging.MessageQueue 
02 MyMQ.Create ("inspiration\myPublicMessageQueue", True) 

To create a private message queue:

 01 Dim myMQ as New Messaging.MessageQueue 02 MyMQ.Create ("inspiration\private$\myPublicMessageQueue") ...

Get Inside ASP.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.