Understanding MSMQ, controlling the ASP process

Source: Internet
Author: User
Tags message queue msmq
We often encounter these situations when using ASP programs: A process takes too long to cause the system to appear "Server is too busy" when the client has expired, the visitor has abandoned access to your site, or a large number of dead queues have been blocked from your server. Error message.
When you're in the process of designing a Web site, an effective solution is to use Microsoft message Queue (MSMQ) to end these processes and get the site back on track!
What kind of thing is MSMQ? Let's take a look at the following:
A basic introduction to Microsoft message Queue:
MSMQ (code-named "Falcon") is a service running in Windows NT that provides asynchronous communication between applications. You can find it in the NT4 Option Pack.
The basic concept of MSMQ is simple: it can be viewed as an email between applications: A message is packaged into a particular type of container, and the message is saved in a specially-functioning queue until the recipient accepts the message. These queues ensure the delivery of MSMQ regardless of the current network connection status.
Like all e-mail messages, an MSMQ message has a sender and a recipient, and the receiver should be able to access the queue. A separate message in a single queue that has multiple recipients such as Respinder. The sender of the message is typically Web Server (IIS).
MSMQ can also communicate with other messaging systems. For example: Sun Solaris, HP-UNIX,OS/2, VMS, as/400 platform. Like other BackOffice services, MSMQ has a COM API (Mqoa.dll) for developers to develop programs. The three most commonly used classes are: MSMQQueueInfo, MSMQQueue, MSMQMessage.
(1), Msqmqueueinfo
MSMQQueueInfo allows you to create new, open, and delete messages in the queue. To establish contact with a queue, you first need to set up PathName, which is the property of a named queue that tells msqm which machine is the queue.
<%
Dim objQueueInfo
Dim Objqueue
Set objqueueinfo=server.createobject ("MSMQ. MSMQQueueInfo ")
Objqueue.pathname = ". Myqu "
Set objqueue = Objqueueinfo.open (mq_send_access, Mq_deny_none)
%>
The code above opens a local queue called Myqueue. If the queue is on another server, the code should be like this:
Objqueue.pathname = "Someothercomputermyqu"
There are two parameters in the open queue: Access and ShareMode.
Access indicates what action will be performed on the queue. There are generally three operations:
Mq_peek_access, Mq_receive_access (1), mq_send_access (2).
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.