Explain what MSMQ is

Source: Internet
Author: User
Tags msmq

MSMQ(Microsoft Message Queue), an asynchronous transfer mode that communicates with multiple different applications, can be distributed on the same machine or distributed in any location in the connected network space, as well. The idea is that the sender of the message puts the information he wants to send into a container (what we call a message) and then saves it to a message queue in a system's public space A local or offsite message receiver is then taken out of the queue to process messages sent to it.

In the message passing mechanism, there are two more important concepts. One is the message, one is the queue. Messages are information that is required by both sides of the communication, which can be a variety of media, such as text, sounds, images, and so on. The end of the message to understand the way, for the message of both sides agreed beforehand, the advantage is that the first is equivalent to a simple encryption of data, and two in their own definition of the format can save the communication of the volume. The message can contain the identity of the sending and the receiver, so that only the specified user can see only the information that is passed to him and returns the receipt for the successful operation. Messages can also contain timestamps to allow the receiver to process certain time-related applications. The message can also contain an expiry time, which indicates that if the message is not reached within the specified time, it is deprecated, and the main application is more closely related to time-sensitive applications.

Message Queuing is the public storage space for sending and receiving messages, which can exist in memory or in physical files. Messages can be sent in two ways, that is,Express Way (Express)AndRecoverable mode (recoverable), the difference is that the express way in order to fast message delivery, put the message in memory, rather than on the physical disk, in order to obtain high processing power, the recoverable mode in each step of the transfer process, the message is written to the physical disk, in order to obtain better recovery capability. Message Queuing can be placed on the same machine as the sender, receiver, or separately on another machine. Because of the flexibility of Message Queuing in the placement mode, the reliability of message delivery mechanism is formed. When a machine that holds Message Queuing fails and restarts, messages sent in recoverable mode can revert to the state they were in before the failure occurred, and messages sent by courier are lost. On the other hand, the use of message delivery mechanism, the sender will need to worry about whether the receiver start, failure, and so on non-essential factors, as long as the message successfully sent out, you can think that the processing completed, and actually the other party may not even boot, or actually complete the transaction may have been the next day.

   The advantage of MSMQ is that because it is asynchronous communication, neither the sender nor the receiver can execute the rest of the code without waiting for the other party to return the success message, thus greatly improving the ability of the processing of the things; the information sending mechanism has a certain function of failure recovery ability MSMQ's messaging mechanism makes it possible for both sides of the message communication to have different physical platforms.

Using the MSMQ functionality provided on Microsoft's. NET platform, you can easily create or delete message queues, send or receive messages, and even manage message queues.

In. NET products, an MSMQ class library is provided "System.Messaging.dll "。 It provides two classes that operate on message objects and Message Queuing objects, respectively. Before you can use the MSMQ feature, you must make sure that the MSMQ Message Queuing component is installed on your machine and that the service is running. When you use ASP. NET programming, you should use the header:

<%@ Assembly name= "System.Messaging"%>
<%@ Import namespace= "system.messsaging"%>


Introduce the MSMQ class library into the ASP. Net file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.