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

  1. <%@ LANGUAGE = JSCRIPT %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Simple MSMQ Transmission (Using Recoverable 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 Recoverable 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.  In this example, the message
  24.         will be sent using the Recoverable Delivery method.  This ensures that 
  25.         the message will not be lost in the event of a crash on any of the MSMQ machines.
  26.         The downside of using the Reoverable Delivery method is that it is slower 
  27.         than the Express Delivery option.  By selecting the "Columns" option within
  28.         the "View" menu of the MSMQ Explorer application, it is possible to display
  29.         the delivery method of each message within a queue.
  30.  
  31.         <p> For this example to work, MSMQ must be first be installed on the host machine.
  32.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  33.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  34.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  35.         queue.
  36.  
  37.         <%
  38.             // Create MSMQQueueInfo Component to Open
  39.             // MessageQueue
  40.  
  41.             QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo")
  42.  
  43.  
  44.             // Open Queue.  The queue could be physically located
  45.             // on any machine. The period in the line below indicates
  46.             // that the queue is located on the local machine.  Note
  47.             // that because JScript is being used as the scripting
  48.             // language, and extra backslash must be inserted
  49.             // as an escape character.
  50.  
  51.             QueueInfo.pathname = ".\\IIS_SDK_EXAMPLE";
  52.             Queue = QueueInfo.Open(2, 0);
  53.  
  54.  
  55.             // Create Message Component for Queue
  56.             
  57.             Msg = Server.CreateObject("MSMQ.MSMQMessage");
  58.  
  59.  
  60.             // Construct Message.  Anything can be passed into both
  61.             // the body and label.  The developer is responsible
  62.             // for marshalling all arguments.  Note that the delivery
  63.             // property has been sent to "Recoverable".  This will
  64.             // guarentee that the message will survive a
  65.             // crash or shutdown on the queue machine.
  66.             
  67.             Msg.body = "This is the message body";
  68.             Msg.Label = "This is the message label";
  69.             Msg.Delivery = 1;
  70.  
  71.  
  72.             // Send Message
  73.             
  74.             Msg.Send(Queue);
  75.  
  76.  
  77.             // Close Queue
  78.             
  79.             Queue.Close();
  80.         %>
  81.  
  82.     </BODY>
  83. </HTML>
  84.