home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / RecoverableDelivery_JScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  75 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> For this example to work, MSMQ must be first be installed on the host machine.
  23.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  24.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  25.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  26.         queue.
  27.  
  28.         <%
  29.             // Create MSMQQueueInfo Component to Open
  30.             // MessageQueue
  31.  
  32.             QueueInfo = Server.CreateObject("MSMQ.MSMQQueueInfo")
  33.  
  34.  
  35.             // Open Queue.  The queue could be physically located
  36.             // on any machine. The period in the line below indicates
  37.             // that the queue is located on the local machine.  Note
  38.             // that because JScript is being used as the scripting
  39.             // language, and extra backslash must be inserted
  40.             // as an escape character.
  41.  
  42.             QueueInfo.pathname = ".\\IIS_SDK_EXAMPLE";
  43.             Queue = QueueInfo.Open(2, 0);
  44.  
  45.  
  46.             // Create Message Component for Queue
  47.             
  48.             Msg = Server.CreateObject("MSMQ.MSMQMessage");
  49.  
  50.  
  51.             // Construct Message.  Anything can be passed into both
  52.             // the body and label.  The developer is responsible
  53.             // for marshalling all arguments.  Note that the delivery
  54.             // property has been sent to "Recoverable".  This will
  55.             // guarentee that the message will survive a
  56.             // crash or shutdown on the queue machine.
  57.             
  58.             Msg.body = "This is the message body";
  59.             Msg.Label = "This is the message label";
  60.             Msg.Delivery = 1;
  61.  
  62.  
  63.             // Send Message
  64.             
  65.             Msg.Send(Queue);
  66.  
  67.  
  68.             // Close Queue
  69.             
  70.             Queue.Close();
  71.         %>
  72.  
  73.     </BODY>
  74. </HTML>
  75.