Message Queuing Architecture


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

Messages

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:

  • A normal message is sent by an application.

  • An acknowledgement message reports the status of a normal message. Acknowledgement messages are sent to administration queues to report success or failure of sending normal messages.

  • Response messages are sent by receiving applications when the original sender requires some special answer.

  • 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.

Messages have two delivery modes: express and recoverable. Express messages are delivered very fast because memory is only used 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> \system32\msmq\storage directory.

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

  • 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 Workgroup environment because the Active Directory is needed. The Active Directory is discussed in Chapter 22,"Working with Active Directory."

  • 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 Workgroup environment.

  • Journal queues are used to keep copies of messages after they have been received or sent. Enabling journaling for a public or a private queue automatically creates a journal queue. With journal queues, two different queue types are possible: source journaling and 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.

  • Contrary to synchronous programming where errors are immediately detected, errors must be dealt with differently using Message Queuing. If a message doesn't arrive at the target system before a specified timeout is reached, the message is stored in the dead-letter queue. The dead- letter queue can be checked for messages that didn't arrive.

  • 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.

  • If more than a simple acknowledgment is needed as an answer from the receiving side, a response queue can be used. The receiving application can send response messages back to the original sender.

  • 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.

  • 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.




Professional C# 2005
Pro Visual C++ 2005 for C# Developers
ISBN: 1590596080
EAN: 2147483647
Year: 2005
Pages: 351
Authors: Dean C. Wills

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net