MSMQ has several Microsoft ActiveX components that you can access within your Active Server Pages (ASP) code or other applications. These components support queue lookup, queue management, message management, queue administration, and transaction support. Four of these components can be found on the Server Objects tab in the Toolbox within Visual InterDev. The main four components in the Toolbox are:
In addition to these components, MSMQ also contains other objects that provide most of the MSMQ API functionality. These include MSMQQueue, MSMQQueueInfos, MSMQEvent, MSMQTransaction, MSMQTransactionDispenser, MSMQApplication, and MSMQCoordinatedTransactionDispenser. There are also many other MSMQ Mail ActiveX objects available for you to script against. For complete details on these objects and their properties and methods, see the MSMQ online documentation.
NOTE
MSMQ fires very few events. The only events fired are Arrived and ArrivedError. These are fired by the MSMQEvent component in response to a message or error arriving at a queue.
We'll now take a more in-depth look at MSMQ Query, MSMQ QueueInfo, MSMQ Message, and MSMQ MailEMail.
The MSMQQuery object allows you to query MSMQ for existing public queues. The LookupQueue method returns a collection of public queues based on the following queue properties: queue identifier, service type, label, create time, and modify time.
The MSMQQueueInfo object provides queue management. It allows you to create a queue (either a transaction or nontransaction queue), open an existing queue, change a queue's properties, and delete a queue.
MSMQQueueInfo objects are either returned by a query or created by you. There is a one-to-one relationship between each MSMQQueueInfo object and the queue it represents. However, there is also a one-to-many relationship between the queue's MSMQQueueInfo object and each open instance of the queue. (Each instance of a queue is referenced by an MSMQQueue object.)
The MSMQMessage object provides properties to define MSMQ messages, plus a single Send method for sending the message to its destination queue. This single method is used for transaction and nontransaction messages.
The MSMQMailEMail object represents an e-mail message. The e-mail message can be a form with several fields, a text message with a single text body, a MAPI TNEF message, or a delivery or nondelivery report.