Pro Visual C++ 2005 for C# Developers

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 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:

Категории