NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Message Queues and Messaging Technology Backgrounder

Microsoft Message Queuing makes it easy for application developers to communicate with application programs quickly and reliably by sending and receiving messages. If you are unfamiliar with MessageQueue technology, this topic provides a brief overview of essential terms and concepts.

Key Concepts in Messaging

A message is a unit of data sent between two computers. A message can be very simple, consisting of just a string of text, or more complex, possibly involving embedded objects.

Messages are sent to queues. A message queue is a container that holds messages while they are in transit. The message queue manager acts as the middleman in relaying a message from its source to its destination. A queue’s main purpose is to provide routing and guarantee the delivery of messages; if the recipient is not available when a message is sent, the queue holds the message until it can be successfully delivered.

Message Queuing, Microsoft’s messaging technology, provides messaging and message queue facilities for any application and among any combination of computers that have Microsoft Windows installed, regardless of whether they are on the same network or online at the same time. A Message Queuing network is any set of computers that are enabled to send messages back and forth to one another. Different computers in the network play different roles in ensuring that messaging proceeds smoothly. Some provide routing information to determine how messages are sent, some hold key information for the entire network, and some simply send and receive messages.

During Message Queuing setup, an administrator makes decisions about which servers can communicate with each other and sets up special roles for specific servers. The computers that make up this Message Queuing network are called sites, and they are connected to one another by site links. Each site link has an associated cost, determined by the administrator, that indicates how quickly messages can be passed across it.

The Message Queuing administrator also sets up one or more computers in the network to act as routing servers. A routing server makes decisions about how a message is delivered by looking at the cost of various site links and determining the quickest and most efficient way to deliver the message across multiple sites.

The following picture shows a typical configuration of Message Queuing sites and how they interact:

Message Routing Between Sites

All of these decisions occur behind the scenes; you do not need to worry about the routing of your messages. You can be assured that Message Queuing will handle the delivery of your messages in the most efficient manner possible.

Types of Queues

There are two main categories of queues — queues that you or other users of the network create, and system queues. User-created queues can be any of the following:

System-generated queues generally fall in one of the following categories:

Most of the work you do in your NGWS frameworks applications will involve accessing public queues and their messages. However, you will most likely use several different kinds of the system queues in your day-to-day operations, depending on your application's need for journal recording, acknowledgment, and other special processing.

Synchronous and Asynchronous Communication

Queue communication can be asynchronous. This means that the person who wants to receive a message can call the BeginReceive method for any given queue and then immediately go on to other tasks without waiting for a reply. This is very different from what is known as synchronous communication.

In synchronous communication, the sender of a request must wait for a response from the intended receiver before performing other tasks. The amount of time that the sender must wait depends entirely on the amount of time it takes for the receiver to process the request and send a response.

For more information on asynchronous processing in message queues, see Asynchronous Message Processing.

Message Security

You can help secure the content of messages that you send and receive in the following ways:

For more information, see Message Queue Security.

Installing Message Queuing

You must have Message Queuing installed on your development computer if you want to work with message queues either in code. You can find instructions on installing Message Queuing in your Windows 2000 or Windows NT documentation. When you install, you must specify whether you are creating a new primary Message Queuing server that will act as the hub of a new network, an independent client of an existing network, or a dependent client of an existing network. In most cases you will not create a new network, but will join the existing Message Queuing network for your company or workgroup.

Where To Go For Background Reading

The remaining topics in this section provide you with the information you need to use Message Queuing components in the NGWS frameworks. If you need more information on messaging technologies outside the context of the NGWS frameworks, there are many sources of information available to you in MSDN and on Microsoft's Web site:

For information about See this topic in your Windows 2000 Server documentation
Setting up a Message Queuing network Installing Message Queueing
General Message Queuing concepts Understanding Message Queuing
Fine-tuning Message Queuing performance Administering Message Queuing

See Also

Message Queuing and E-mail Systems| Incorporating Messaging Into Applications