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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.