Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

How Do I...? Common Tasks QuickStart Tutorial

How Do I...Control a message queue?



Message queuing makes it easy for application developers to communicate with application programs quickly and reliably by sending and receiving messages. Messaging provides you with guaranteed message delivery and a robust, fail-safe way to carry out many of your business processes.

The MessageQueue component allows you to easily incorporate message-based communication into your applications. Using this component and its associated language features, you can send and receive messages, explore existing queues, create and delete queues, and perform a variety of other operations using a simple programming model.

This sample illustrates how to change some properties of a message queue. It is a small console application that can be run from a command prompt. Run the sample without any command-line arguments and it will print its full usage instructions.

For example, if you want change a queue's label, run:
> MQCtrl.exe MyQueue l "New Label"


In its simplest form, changing a property of a message queue involves:
  1. Creating a new instance of a MessageQueue component and pointing it to an existing queue:

    		
    MessageQueue mq = new MessageQueue(mqPath);
    
    C#


  2. Setting the property to a new value:

    		
    mq.Label = "New Label";
    
    C#

Example

VB MQCtrl.exe
View Source
[This sample can be found at C:\DevFusion.Data\legacy\quickstart.developerfusion.co.uk\QuickStart\howto\samples\Services\MessageQueue\MQCtrl\]



Microsoft .NET Framework SDK QuickStart Tutorials Version 2.0
Copyright � 2004 Microsoft Corporation. All rights reserved.