MessageQueue in .NET, Part 1: The Background Work on Windows


Hello and welcome to my article. Today, I'd like to speak about MessageQueue in .NET. But, to do that, I need to explain how MSMQ works in the background. So, this will be Part 1, and in Part 2 we will do it practically in .NET

What Is MSMQ?

Microsoft Message Queuing (MSMQ) is a messaging protocol that allows applications running on separate processes or servers to communicate. A queue, in this sense, is a temporary storage location from which messages can be sent and received, thus enabling communication across networks and between Windows PCs, which may not always be connected.

MSMQ delivers messages reliably between applications inside and outside the enterprise. Reliably because it places messages that fail to reach their destinations in a queue and then resends them when the destination becomes reachable.

Installing MSMQ

To install MSMQ, you do not need any third-party software (just in case you were wondering). Follow these steps:

  1. Open your Control Panel.
  2. Open Programs and Features, as shown in Figure 1.

    Programs and Features
    Figure 1: Programs and Features

  3. Select Turn Windows Features on or off. This produces another dialog box.
  4. Select the checkboxes next to MSMQ, as shown in Figure 2.

    Install MSMQ
    Figure 2: Install MSMQ

  5. Click OK. It will install and it will take some time, so be patient.

After it has installed, let's make sure by using the next few steps:

  1. Open the Control Panel.
  2. Open Administrative Tools, as shown in Figure 3.

    Administrative Tools
    Figure 3: Administrative Tools

  3. Open Computer Management, as you can see in Figure 4.

    Computer Management
    Figure 4: Computer Management

You should see the Message Queueing service. This means it is ready.

We will come back to this after we have written the programs to communicate with one another.


Now that we have done the background work, we are ready to create two different apps to communicate with one another. This will be the substance of Part 2. Until then, happy coding.

This article was originally published on January 15th, 2020

About the Author

Hannes DuPreez

Hannes du Preez is a self-taught developer who started learning to program in the days of QBasic. He has written several articles over the years detailing his programming quests and adventures. .NET is his second love, just after his wife and kid. He has always been an avid supporter of .NET since the beginning and is an expert in VB and C#. He was given the Microsoft Most Valuable Professional Award for .NET (2008–2017). He has worked as a moderator and an article reviewer on online forums and currently works as a C# developer and writes articles for CodeGuru.com, Developer.com, DevX.com, and the Database journal.
His first book Visual Studio 2019 In Depth is currently on sale on Amazon and Bpb Publications.

You could reach him at: ojdupreez1978[at]gmail[dot]com

Related Articles

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date