Understanding MSMQ, controlling the ASP Process (ii) (paste)

Source: Internet
Author: User
Tags iis msmq
Process | Control in the application of MSMQ can have a lot of applications, but the most common use is to uninstall the process in another thread. (such as IIS on the same machine as MSMQ) or IIS on a different machine. By uninstalling these blocked processes, you can enable the ASP program to continue to run.

In general, there are two things you should do to determine whether you need to uninstall a task process:

One is based on the time that the process runs.

The second is based on whether the user has a response (for example, a user in a chat room has not spoken for hours).

For example, if a server-side Web page task takes too long, the user gets a page timeout error message, we can generally refresh or simply discard the page by clicking it again. But now you can change the way you handle things, such as background processing, rather than simply adding time to the page. You know, background processing can also improve the performance of the site.

MSMQ also has the ability to control a specific COM object in the body of a message. This is OK as long as the object supports the IDispatch and IPersist (IPersistStream or IPersistStorage) interfaces.

One of the most commonly used, can support the two is ADODB. Recordset (or Ador. Recordset) and Word.Document. In the following we give a processing ADODB. Recordset example.

Example: How to deal with ADODB. Recordset:
Public Sub Sendrecordsetinmessage ()
Dim Objqinfo as New MSMQ. MSMQQueueInfo
Dim Objqsend as MSMQ. MSMQQueue
Dim objmessage as New MSMQ. MSMQMessage
Dim objRS as New ador. Recordset
Dim A as New msmqqueue
With objRS
. CursorLocation = adUseClient
. Fields.Append "FN", adVarChar, 25
. Fields.Append "LN", adVarChar, 25
. Open
. AddNew
. Fields ("FN") = "Chris"
. Fields ("LN") = "Blexrud"
. Update
. AddNew
. Fields ("FN") = "Shayna"
. Fields ("LN") = "Blexrud"
. Update
End With
Objqinfo.pathname = ". \test"
Set objqsend = Objqinfo.open (mq_send_access, Mq_deny_none)
Objmessage.label = "Recordset State!!!!"
Objmessage.body = objRS
Objmessage.send Objqsend
Objqsend.close
Set Objqinfo = Nothing
Set objqsend = Nothing
Set objmessage = Nothing
Set objRS = Nothing
End Sub


Do you know about MSMQ? I think now for the process of ASP deadlock, you already have a very good solution for it! I hope you can learn more about MSMQ and how to control the ASP process through MSMQ.



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.