Network Programming in .NET: With C# and Visual Basic .NET

In all of the networking examples so far, it is necessary for the client and server to be running at the same time in order for communication to be sent between them. Message queuing software facilitates the construction of queues between client and server over an impermanent connection, such that messages are stored until a connection is present. Microsoft Message Queue (MSMQ) is the most applicable system for .NET, but other products such as IBM WebSphere MQ (www.ibm.com/software/ts/mqseries) or TIBCO RendezVous (http://www.tibco.com/software/enterprise_backbone/rendezvous.jsp ) are alternatives.
Message queuing is often used as a backup system for whenever a communication link fails between two servers. This improves overall system stability in the event of catastrophic failure. This type of fallback mechanism is vital in systems where out-of-sync data between sites could cause opportunities for malicious users to defraud the system. One could imagine if a person were to withdraw funds from two ATMs simultaneously, during a temporary interbank communications link failure. If the ATMs did not propagate the transactions back to the bank once the link was restored, then the person could run away with double the available balance.
This chapter begins by describing the basics of MSMQ and providing examples of how to send and receive objects via a message queue. This topic is then developed toward the end of the chapter by detailing other features of MSMQ, which help manage how messages are sent through the system.
A common application for MSMQ is where...