Export (0) Print
Expand All

Creating Transactional Queues

A transactional queue is created for the specific purpose of receiving and processing messages that are sent as part of a transactional activity. Nontransactional queues are unable to process messages that have been included in a transactional activity.

To send messages as part of a transactional activity, the receiving queue must be set to process transactions. This can be done programmatically by setting its Transactional property to true.

To create a transactional queue

  1. Add a reference to the System.Messaging.dll. For more information, see Adding and Removing References.
  2. Use the overloaded Create constructor to create a public, transactional queue, setting the second parameter to true to indicate that the queue should be transactional.
    ' Visual Basic
    Dim mq2 As New System.Messaging.MessageQueue
    mq2 = System.Messaging.MessageQueue.Create(".\MyTransQueue", True)   
    
    // C#
    System.Messaging.MessageQueue mq2 =
       new System.Messaging.MessageQueue();
    mq2 = System.Messaging.MessageQueue.Create(".\\MyTransQueue",true);
    
    Note   This syntax creates a public transactional queue. The exact syntax you use in the first parameter depends on the kind of queue you are trying to create. For more information, see Queue Reference Recommendations.

See Also

Reading and Receiving Messages | Transactional Message Processing | Sending Messages Within Internal Transactions | Creating Queues | Adding and Removing References | Queue Reference Recommendations | Walkthrough: Creating a Message Queue Transaction with COM+ Services

Show:
© 2014 Microsoft