home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / ExpressDelivery_JScript.asp < prev    next >
Encoding:
Text File  |  1997-09-04  |  2.5 KB  |  78 lines

  1. <%@ LANGUAGE = JScript %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Simple MSMQ Transmission (Using Express Delivery)</TITLE>
  6.     </HEAD>
  7.  
  8.     <BODY bgcolor="white" topmargin="10" leftmargin="10">
  9.  
  10.         
  11.         <!-- Display Header -->
  12.  
  13.         <font size="4" face="Arial, Helvetica">
  14.         <b>Simple MSMQ Transmission (Using Express Delivery)</b></font><br>
  15.       
  16.         <hr size="1" color="#000000">
  17.  
  18.         This sample demonstrates how to send a simple asynchronous message using 
  19.         the Microsoft Message Queueing Server (MSMQ).  MSMQ is one of the components
  20.         that comes with the Windows NT 4.0 Option Pack.
  21.   
  22.         <p> This sample will open the "IIS_SDK_EXAMPLE" queue located on the local
  23.         machine, and transmit a simple message to it.  Because we have not specified
  24.         otherwise, the message will be sent using the default express delivery method.
  25.         This means that, in the event of a crash on the MSMQ machine, the message
  26.         will be lost.  The advantage of express delivery, however, is that messages
  27.         can be sent very quickly.
  28.  
  29.         <p> For this example to work, MSMQ must be first be installed on the host machine.
  30.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  31.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  32.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  33.         queue.
  34.  
  35.         <%
  36.             // Create MSMQQueueInfo Component to Open
  37.             // MessageQueue
  38.  
  39.             QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo");
  40.  
  41.  
  42.             // Open Queue.  The queue could be physically located
  43.             // on any machine.  The period in the line below indicates
  44.             // that the queue is located on the local machine.  Note
  45.             // that because JScript is being used as the scripting
  46.             // language, and extra backslash must be inserted as an
  47.             // escape character.
  48.  
  49.             QueueInfo.pathname = ".\\IIS_SDK_EXAMPLE"
  50.             Queue = QueueInfo.Open(2, 0);
  51.  
  52.  
  53.             // Create Message Component for Queue
  54.             
  55.             Msg = Server.CreateObject("MSMQ.MSMQMessage");
  56.  
  57.  
  58.             // Construct Message.  Note than anything can be
  59.             // passed into both the body and label.  The developer
  60.             // is responsible for marshalling all arguments.
  61.             
  62.             Msg.body = "This is the message body";
  63.             Msg.Label = "This is the message label";
  64.  
  65.  
  66.             // Send Message
  67.             
  68.             Msg.Send(Queue);
  69.  
  70.  
  71.             // Close Queue
  72.             
  73.             Queue.Close();
  74.         %>
  75.  
  76.     </BODY>
  77. </HTML>
  78.