Welcome   |  ASP.NET   |  Web Services   |  How Do I...?   |  Class Browser  | WPF Quick Starts
  |   I want my samples in...   

How Do I...? Common Tasks QuickStart Tutorial

Go To...

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

C# MQCtrl.exe
View Source

[This sample can be found at M:\web\users\sites\AspnetQuickStart\v2.0\QuickStart\howto\samples\Services\MessageQueue\MQCtrl\
To build this sample, open the SDK command prompt and navigate to the above path. Build the sample using the build tool msbuild passing the solution file as the first parameter: msbuild mySample.sln. The compiled executable will be found in the sub directory \bin directory.]




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


Hosted by MaximumASP | Found a broken link? | Contact Us | Terms and conditions | Privacy Policy | Advertise with us
� 2000 - 2010  Mindcracker LLC. All Rights Reserved