Messaging

Messaging
Messaging is the process of sending messages from a client to a server. All networking protocols we have seen up to now require a connected environment. No matter if we use TCP or UDP sockets, the HTTP protocol, or .NET Remoting, the client and server must be running concurrently: that is, at the same time. With message queuing, the client and server can be running at different times, and the client can send messages even when the connection to the server is not be available. The message will be queued, and will reach the server at a later time. Message queuing also gives us an easy way to set priorities for messages, which can be useful in a connected environment too, where we may wish to read higher priority messages first.
One scenario where message queuing can be particularly useful is when an application is run on a portable computer not connected to the company network, perhaps belonging to a sales person at a customer's site. Message queuing allows the application to send a message, but store it in the message queue of the client until connected back to the network. As far the application that sends the message is concerned, the message is sent immediately.

The System.Messaging namespace houses the .NET classes that provide message queuing. For more about .NETProgramming using Message Queuing, read Data-Centric .NET Programming with C# (Wrox Press, ISBN 1-86100-592-X).