Using Microsoft Message Queue


MSMQ offers reliable messaging infrastructure closely integrated with the Microsoft Windows platform. MSMQ configurations vary from heavyweight transactional services on the server platforms to simple routing services on the workstation platforms.

MSMQ is normally installed as an extra operating system service option. In the case of most workstation platforms, it is not installed by default. This seriously affects the enterprise application developer. If your solution requires messaging services on at the client side, you need to determine if it is installed. Ideally, you will do this when you install your client software. Minimally, you should provide a compatibility test application to check if a client computer is ready to support your application.

Managing Message Queues

You can create message queues manually or programmatically. To create a message queue manually, first check to ensure that MSMQ is installed locally by opening the Control Panel, opening Add or Remove Programs, selecting Add/Remove Windows Components, and validating that the Message Queuing component is checked. If installed, open the Computer Management console by selecting Start ˜ Control Panel ˜ Administrative Tools ˜ Computer Management. Expand the Services and Applications tree node and then expand the Message Queuing tree node. You should see a list of public, private, and system message queues. To create a new private message queue, right-click the Private Queues tree node and select New ˜ Private Queue from the context menu. A prompt for the message queue name appears, as shown in Figure 4-1. Once you enter a name and the dialog box closes , the queue is available.

click to expand
Figure 4-1: Creating a new MSMQ private message queue

With the appropriate access rights, deleting message queues requires about the same effort as creating them. You can delete message queues manually from the Computer Management console by highlighting the message queue and pressing the Delete key.

Understanding the Limitations of Servers and Workstations

MSMQ supports the creation of public and private message queues. However, depending upon which operating system your application runs on, you might be able to create and access only certain types of message queues.

On Windows servers ”including Windows NT, 2000, and 2003 Server ”both a user and an application are capable of creating public message queues. Public message queues can receive and route messages from any other application within the network. Workstation computers ”such as Windows 95, 98, and Millennium Edition ”support only the creation of private message queues. Private message queues support only messages sent from one application on the local computer to another application on the local computer. Also, workstation computers behave differently whether they operate as stand-alone computers or within a domain. When operating within a domain, they disable support for journal and dead-letter message queues. Finally, Windows XP is able to create public and private message queues. When developing applications that implement a messaging framework, bear in mind which platform the product will be installed on so that the installation program is able to create a public or private message queue as needed.




Developing. NET Enterprise Applications
Developing .NET Enterprise Applications
ISBN: 1590590465
EAN: 2147483647
Year: 2005
Pages: 119

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net