In Chapter 8, we discussed how to implement simple COM+ applications. You learned three methods for constructing the components youll use for COM+ application building blocks. This chapter extends the information you learned in that chapter by showing how to augment the functionality of COM+ with the functionality of Microsoft Message Queuing Services (MSMQ).
Of course, the first thing youll want to know is how MSMQ adds to the functionality that COM+ provides. All of the communication mentioned in Chapter 8 was synchronousit occurred in real time. The server and the client had to exist at the same time in order for communication to occur. MSMQ adds an asynchronous processing capability to COM+ applications. This feature helps the developer create applications that work just as well without a connection as they do with a connection. In addition, queued applications can provide a form of load balancing by allowing the server to continue receiving messages even when it doesnt have time to process them immediately.
Its impossible to test the applications in this chapter properly using a single machine setup. The point of this chapter is that the client and the server exist on two separate machines. The examples emphasize that you can disconnect the client from the server and the application will still work. If you use a single machine setup to work with the examples in this chapter, youll miss part of the reason for building this kind of application.
Once you understand how MSMQ relates to the COM+ and.NET environment, well begin looking at examples of queued applications. In this case, well always create the component using .NET. However, because you dont know whether a particular platform will support .NET, you must look at both managed and unmanaged clients a topic well pursue in this chapter. Well also discuss what happens when a connection fails so that you understand why disconnected support is so important.
This chapter assumes youve already installed the minimum components required for Message Queuing. Youll find this installation option in the Windows Components list of the Windows Components Wizard. Access this wizard by clicking Add/Remove Windows Components in the Add Or Remove Programs applet in the Control Panel. The chapter will use only the minimal setupyou wont need access to the HTTP support provided in newer versions of Windows.