Introduction to Microsoft Message Queue (MSMQ)

Microsoft Message Queue is message based protocol technology that provides a way to communicate asynchronously in a distributed environment. Microsoft Message Queue is also known as MSMQ for short, code name “Falcon”.

MSMQ is one of the best proven ways to engineer for developing distributed enterprise business solutions. It provides asynchronous and disconnected pattern of communication between different components of an enterprise application. Different application can work in isolation and can communicate or pass information to other application using this message protocol.

MSMQ is service which manages queues. These queue stores message used for communication or to pass information. MSMQ is part of Microsoft OS from time of Windows NT 4 and Windows 95. It was introduced in late 1997 and become a part of Microsoft Embedded platforms from 1999. MSMQ is also called Message – Oriented Middleware (MOM).

MSMQ Versions

First Version 1.0 of MSMQ was released in May 1997 for Windows 95, Windows NT 4.0, Windows 98 and Windows Me.

Later on at the time when Windows 2000 was released, MSMQ Version 2.0 was introduced with more features like public message queue Active Directory (AD) registration, 128-bit encryption, digital certificate support, full COM support for message properties, DNS path name support and improved performance in multi-threaded applications.

MSMQ Version 3.0 was introduced with Windows XP and Windows Server 2003 where MSMQ came with web enabled message functionality, queue aliases, message multicasting etc.

At the time Windows Vista and Windows Server 2008, MSMQ incorporated more features as Version 4.0 which includes sub-queues, more support for solving “Poison messages” problem and support for transactional receives of message from a remote queue.

The last version of MSMQ is Version 5.0 which was released with Windows 7 and Windows Server 2008 R2. This version of MSMQ provided support for Secure Hash Algorithm 2.0 (SHA2) and other standard hash algorithms.

Default Communication Ports Used by MSMQ

TCP Protocol: 1801.
UDP Protocol: 3527, 1801.
RPC: 135, 2101, 2103, 2105.

Using MSMQ

MSMQ can be used in DOMAIN as well as WORKGROUP environment. MSMQ is available as a windows feature, which can be enabled /disabled in any windows operating system. It is disabled by default in all the operating systems. In desktop environment MSMQ can be enabled by:
Open Start > Control Panel > Programs and Features > Turn Windows features on or off (Left pane) > Microsoft Message Queue (MSMQ) Server.

Install MSMQ on Windows 7

In Windows 7, MSMQ comes with following features:

Microsoft Message Queue (MSMQ) Server Core

  • MSMQ Active Directory Domain Services Integration
  • MSMQ HTTP Support
  • MSMQ Triggers
  • Multicasting Support
  • MSMQ DCOM Proxy

In server environment MSMQ is available as part of add / remove feature. MSMQ can be enabled by opening “Add features wizard” from Server Manager.

Install MSMQ on Windows 2008 / R2

In Windows Server 2008 R2, MSMQ comes with these features:
Message Queuing Service

  • Message Queuing Services
  • Directory Service Integration (Machine should be part of Domain)
  • Message Queuing Triggers
  • HTTP Support (IIS and Windows Activation Services – WAS required)
  • Multicasting Support
  • Routing Service
  • Message Queuing DCOM Proxy

Message Queuing Service

This is the core service that is installed when MSMQ feature is enabled. This includes the basic queue functionalities and services related to it. Messages can be received and send to queues. Application using MSMQ can be programmed using System.Messaging; namespace of Microsoft .NET framework.

Message queue directory service integration

It enables Message queuing to function in domain mode. It allows to publish queue properties to Active Directory Domain Service (AD DS), provides authentication for queues, encryption using certificates registered in AD DS and routing of messages with Message Queuing sites.

Message queuing Triggers

MSMQ Triggers is feature associated with a message queue. It can be invoked every time a Message arrives in queues. An action or a process can be executed when these automated triggers are fired in response to message queue event.

HTTP Support

This feature provides support for reference queues using HTTP protocol and HTTP message authentication using an XML digital signature.

Multicasting Support

A traditional MSMQ model allows a single message to send to a single queue. Using Multicasting feature of MSMQ, one-to-many message model can be enabled to send same message to multiple queues.

Routing Service

This service gives the client application the ability to send messages to their destination using least-cost routing. The administrator only needs to define the cost of each route, and MSMQ will automatically calculate the most economical path for the message. Routing service removes the single point of failure problem. MSMQ re-route message to overcome network issues and makes it more efficient in case of unreliable networks like internet.

MSMQ comes with an out-of-box explorer which can be used to monitor and manages queues and functionalities. It can be found under Computer Management > Services and Applications > Message Queuing or Windows + R – type compmgmt.msc.

There are some good professional third party tools to manage MSMQ like:

Developers and programmers can post question and queries to official Microsoft Message Queuing (MSMQ) Forum.

MSMQ development API reference to MSDN namespace – System.Messaging.

Last updated on: 1st September, 2016

Show Comments