Managing Microsoft Message Queue (MSMQ)

In this part of my sharing we will take a tour of the robust and user-friendly Message Queue (MSMQ) explorer provided by Microsoft out-of-box to manage all basic task related to message queue.

To open MSMQ explorer navigate to

Control Panel > Administrative Tools > Computer Management > Services and Applications (Left pane) > Message Queuing

or you can open the same by Windows + R and type compmgmt.msc. Tadaaaam.

First look to MSMQ you will see following structure:

MSMQ Explorer First Look

  • Outgoing Queues
  • Public Queues
  • Private Queues
  • System Queues
  • Triggers

Public and Private queues are the two types of queues you can create in MSMQ. By right-click on public queues or private queues folder item you can create a new queue.

If you have installed MSMQ in workgroup mode, the public queue will be crossed out (striked out) as shown in above screenshot. On trying to open this item an error is prompted:

Not all public queues can be displayed. Only public queues cached locally can be displayed. Error: A local user is authenticated as an anonymous user and cannot access Active Directory Domain Services. You need to log on as a domain user to access Active Directory Domain Services.

This is because public queues can only be accessed through domain environment and users. They are tightly integrated with Active Directory Domain Services (AD DS). Public queues can be accessed across the domain network accessed using domain user.

A dialog appears when you create new queue (public or private, most of the options for public and private queues remain same).

Create new public or private queue

Here you can specify the name of the queue and check / un-check to make queue transactional. It shows the hostname where the queue will be created.

In the private queue detailed pane, you can see all the queues created on the local machine as list with name, label, number of messages, number of journal messages.

Right-click on any queue gives two options Delete and Properties. You can delete the queue from there or you can modify properties of this message queue.

MSMQ message queue properties

This dialog consists of three tabs: General, Multicast and Security.

General

This property tab consists of all the basic option which can be configured for a message queue.

Path Name: The top section of general tab shows the path name of this message queue.

Label: It contains the label value of the path name or the pathname without the hostname.

Type ID: This consists of a GUID that identifies the type of queue. It help to organize the message queues in groups and categorize it properly. The type id to be used for testing a Message Queuing network – {55EE8F32-CCE9-11CF-B108-0020AFD61CE9}.

Limit Message Storage to (KB): The size of the MSMQ can be set using this option. The size of MSMQ is the total of size of all message stored in the queue.

Authenticated: If this is checked only authenticated users can access the message queue. If it is not checked all users and any anonymous users can also have access to this queue. If this option is not checked as warning is displayed at the bottom of the tab:

Queue is unauthenticated. Message senders can bypass the Access Control settings specified in the Security tab

Queue Transaction Option: This option can be used to create a queue as transactional or non-transactional queue.

Privacy Level: This defines the level of encryptions used for the message in the queue. It consists of three options – None, Optional and Body. If privacy level of message queue is set to None then queue can store only unencrypted messages. If privacy level is set to Body, then the queue can only accept encrypted messages. If its set to Optional (default selected), then the queue can accepts both encrypted and unencrypted messages.

Journal Message and size: This option can be used to enable / disable journal messages for this queue and size of journal message queue for this queue. This type of queue is used to create a copy of message in and out of queues either while sending or receiving from queue.

Multicast

This property tab is used to associate a multicast address and port number which can used to use multicasting for queue message across its network.

Security

This property tab contains the rights and permission – user list for this message queue.

The set of permissions available which can be applied to any user / group for a private queue:

  • Full Control
  • Delete
  • Receive Message
  • Peek Message
  • Receive Journal Message
  • Get Properties
  • Set Properties
  • Get Permissions
  • Set Permissions
  • Take Ownership
  • Send Message
  • Delete Message
  • Delete Journal Message

Note: Message cannot be added directly from the message queue explorer. You can clear or purge a queue like this:

Purge / clear messages from MSMQ message queue

Every message queue has three child sections:

  • Queue messages
  • Journal messages
  • Triggers.

Queue messages contain the actual received messages. The right pane shows the list of all the messages in the queue as Label, Priority, Class, Size and Message ID (GUID).

Journal messages contain the copy of message successfully received or dequeued from the queue (if this option is configured for this queue).

Triggers are used to manage trigger rules attached to this queue.

Right Click on any message and open properties, there are four tabs:

  • General
  • Queues
  • Sender
  • Body

General tab: This contains summary for this message.

Queues tab: Shows the Recipient, Destination, Administration, Response and Dead-letter information regarding this message.

Sender tab: Presents details of Source computer, Sender, Security information of this message.

Body tab: Shows body content based on the serialization formatter used while queuing this message.

System Queues

This section of MSMQ explorer displays three sub categories – Journal message, Dead-letter message, Transactional dead-letter messages which are used internally by MSMQ to manage user defined message queues.

By default, MSMQ store message as files in C:\Windows\System32\msmq\storage folder, it also contains all MSMQ logs and transcation logs. MSMQ server property page provide options to Enable / disable un-authenticated RPC calls. Set remote receive security option and to set the security used while receiving message from Internet. It also shows security tab which only shows options if the MSMQ is accessed by domain user and is installed in domain-mode.

Triggers section which can be used to create triggers rules based on different events of a message queue and execute a process or library function when the configured event is fired.

This ends our little tour of the MSMQ queue explorer and basic management features provided via this handy interface.