Message Queuing Architecture C# Help

With Message Queuing, messages are written to and read from a message queue. Messages and message queues have several attributes that must be further elaborated.


A message is sent to a message queue. The message includes a body containing the data that is sent and a label that is the title of the message. Any information can be put into the body of the message. With .NET, several formatters convert data to be put into the body. In addition to the label and the body, the message includes more information about the sender, timeout configuration, transaction ID, or priority.

Message queues have several types of messages:

  1. A normal message is sent by an application .
  2. An acknowledgment message reports the status of a normal message. Acknowledgment messages are sent to administration queues to report success or failure when sending normal messages.
  3. Response messages are sent by receiving applications when the original sender requires some special answer.
  4. A report message is generated by the Message Queuing system. Test messages and route-tracking messages belong to this category.

A message can have a priority that defines the order in which the messages will be read from the queue. The messages are sorted in the queue according to their priority, so the next message read in the queue is the one with the highest priority.

Message have two delivery modes: express and recoverable. Express messages are delivered very quickly because memory is used only for the message store. Recoverable messages are stored in files at every step along the route until the message is delivered. This way, delivery of the message is assured, even with a computer reboot or network failure.

Transactional messages are a special version of recoverable messages. With transactional messaging, it is guaranteed that messages arrive only once and in the same order that they were sent. Priorities cannot be used with transactional messages.

Message Queue

A message queue is a message store Messages that are stored on disk can be found in the <windir> \systern32\rnsrnq\storagedirectory.

Public or private queues are usually used for sending messages, but other queue types also exist:

  1. A public queue is published in the Active Directory. Information about these queues is replicated across Active Directory domains. You can use browse and search features to get information about these queues. A public queue can be accessed without knowing the name of the computer where it is placed. It is also possible to move such a queue from one system to another without the client knowing it. It’s not possible to create public queues in a Work group environment because the Active Directory is needed. The Active Directory is discussed in Chapter 46, “Directory Services.
  2. Private queues are not published in the Active Directory, These queues can be accessed only when the full path name to the queue is known. Private queues can be used in a Work group , environment.
  3. Journal queues are used to keep copies of messages after they have been received or sent. Enabling journaling for a public or private queue automatically creates a journal queue. With journal queues, two different queue types are possible: source journalingand target journaling, Source journaling is turned on with the properties of a message; the journal messages are stored with the source system. Target journaling is turned on with the properties of a queue; these messages are stored in the journal queue of the target system.
  4. Dead-letter queues store messages if a message doesn’t arrive at the target system before a specific timeout is reached. Contrary to synchronous programming where errors are immediately detected, errors must be dealt with differently using Message Queuing. The dead-letter queue can be checked for messages that didn’t arrive.
  5. Administration queues contain acknowledgments for messages sent. The sender can specify an administration queue from which it receives notification of whether the message was sent successfully.
  6. A response queue is used if more than a simple acknowledgment is needed as an answer from
    the receiving side. The receiving application can send response messages back to the original sender.
  7. A report queue is used for test messages. Report queues can be created by changing the type (or category) of a public or private queue to the predefined ID {55EE8F33-CCE9-11CFB108- 0020AFD61CE9}. Report queues are useful as a testing tool to track messages on their route.
  8. System queues are private and are used by the Message Queuing system. These queues are used for administrative messages, storing of notification messages, and to guarantee the correct order of transactional messages.


Posted on October 31, 2015 in Message Queuing

Share the Story

Back to Top
Share This