home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / RecoverableDelivery_VBScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  79 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <%  Option Explicit     %>
  3.  
  4.  
  5. <HTML>
  6.     <HEAD>
  7.         <TITLE>Simple MSMQ Transmission (Using Recoverable Delivery)</TITLE>
  8.     </HEAD>
  9.  
  10.     <BODY bgcolor="white" topmargin="10" leftmargin="10">
  11.  
  12.         
  13.         <!-- Display Header -->
  14.  
  15.         <font size="4" face="Arial, Helvetica">
  16.         <b>Simple MSMQ Transmission (Using Recoverable Delivery)</b></font><br>
  17.       
  18.         <hr size="1" color="#000000">
  19.  
  20.         This sample demonstrates how to send a simple asynchronous message using 
  21.         the Microsoft Message Queueing Server (MSMQ).  MSMQ is one of the components
  22.         that comes with the Windows NT 4.0 Option Pack.
  23.   
  24.         <p> For this example to work, MSMQ must be first be installed on the host machine.
  25.         Using the MSMQ Explorer, a queue named "IIS_SDK_EXAMPLE" should then be created.
  26.         After the example is run, return to the MSMQ Explorer and select "Refresh" from
  27.         the "View" menu.  The recently sent message will then appear within the "IIS_SDK_EXAMPLE"
  28.         queue.
  29.  
  30.         <%
  31.             Dim QueueInfo
  32.             Dim Queue
  33.             Dim Msg
  34.  
  35.  
  36.             ' Create MSMQQueueInfo Component to Open
  37.             ' MessageQueue
  38.  
  39.             Set 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.
  45.  
  46.             QueueInfo.pathname = ".\IIS_SDK_EXAMPLE"
  47.             Set Queue = QueueInfo.Open(2, 0)
  48.  
  49.  
  50.             ' Create Message Component for Queue
  51.             
  52.             Set Msg = Server.CreateObject("MSMQ.MSMQMessage")
  53.  
  54.  
  55.             ' Construct Message.  Anything can be passed into
  56.             ' both the body and label.  The developer is responsible
  57.             ' for marshalling all arguments.  Note that the delivery
  58.             ' property has been sent to "Recoverable".  This will
  59.             ' guarentee that the message will survive a crash or
  60.             ' shutdown on the queue machine.
  61.             
  62.             Msg.body = "This is the message body"
  63.             Msg.Label = "This is the message label"
  64.             Msg.Delivery = 1
  65.  
  66.  
  67.             ' Send Message
  68.             
  69.             Msg.Send Queue
  70.  
  71.  
  72.             ' Close Queue
  73.             
  74.             Queue.Close
  75.         %>
  76.  
  77.     </BODY>
  78. </HTML>
  79.