Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Designing Applications with MSMQ: Message Queuing for Developers

Designing Applications with MSMQ: Message Queuing for Developers

by Alan Dickman, Peter Houston (Foreword by)

"This book is an invaluable resource for learning about MSMQ."
--Peter Houston
MSMQ Product Manager, Microsoft Corporation

Microsoft Message Queue Server (MSMQ)--which is incorporated into the newest version of Windows NT--brings asynchronous transaction processing (TP) capabilities to the Windows platform for the first time. MSMQ combines


"This book is an invaluable resource for learning about MSMQ."
--Peter Houston
MSMQ Product Manager, Microsoft Corporation

Microsoft Message Queue Server (MSMQ)--which is incorporated into the newest version of Windows NT--brings asynchronous transaction processing (TP) capabilities to the Windows platform for the first time. MSMQ combines the high performance and robustness of mainframe transaction processing with a flexibility of objects, an administrative ease-of-use, and an ability to scale. As such MSMQ is a key technology contributing to the growth of Internet commerce and intranet distributed processing.

Whether you are a Windows programmer who is new to transaction processing or a UNIX programmer who wants to learn more about MSMQ, this book will introduce you to the topic and show you how to develop transaction-processing applications using the MSMQ technology.

Designing Applications with MSMQ offers an overview of the general design of queued messaging applications and a discussion on how MSMQ can be used in two-tier, three-tier, Web, and component architecture applications. This book also provides a detailed description of MSMQ architecture, queue, and message properties, as well as a detailed description of how MSMQ interacts with other transaction technologies, such as MTS and SQL Server.

A step-by-step tutorial shows you how to write MSMQ applications using COM components, Visual Basic, Visual C++, and the MSMQ API. In addition to the tutorial, this book offers a comprehensive introduction to transaction processing and develops a full-scale application using MSMQ that illustrates the technology's power and potential for this emergent field.


Editorial Reviews

A guide for Windows or Unix programmers to a transaction processing technology, which is built into the newest versions of Windows NT. Overviews the general design of queued messaging applications and discusses how MSMQ can be used in two-tier- three-tier, Web, and component architecture applications. Also describes the architecture, queue, and message properties and how the system interacts with other transaction technologies such as MTX and SQL Server. No bibliography. Annotation c. by Book News, Inc., Portland, Or.
Dino Esposito

Where Do You Want To Queue Today?

Microsoft Message Queue (MSMQ) is relatively new software for Microsoft, but not a new kind of software; other vendors have sold similar products for a long time. MSMQ, however, represents Microsoft's first crack at asynchronous, time-independent transaction processing. But although MSMQ is new in Microsoft's space, it is important since it is incorporated in Windows 2000 and merged in older versions through the NT 4.0 Option Pack. Also, MSMQ will be tightly integrated with COM+, the next generation of COM.

Once you've decided that your middleware should be based on a queue, MSMQ becomes a primary option to consider. Designing Applications With MSMQ, by Alan Dickman, examines MSMQ from the perspective of application design, rather than, say, a programmer's reference for using MSMQ. Ultimately, the book explains why you may need MSMQ within a queued messaging system and how to take advantage of it.

Three key aspects of Designing Applications With MSMQ struck me as significant:

  • The author's knowledge and expertise.
  • The overall developer slant that is useful to managers too.
  • The open vision of the problem that is focused on Microsoft environments, but not blindly based only on them.

These three aspects are correlated and work together, confirming that the book is really the result of Dickman's direct experience with and understanding of MSMQ.

I particularly liked the attention to the manager's point of view. MSMQ is not the kind of product that a single developer would use. It's not like a compiler or a code editor. MSMQ is an important element in a three-tier, distributed, enterprise, and mostly web-based application. The goal of the book, well-expressed by the title, is to show how to design applications using MSMQ. However, the majority of the chapters are clearly for developers and contain plenty of programming details. In other words, Designing Applications With MSMQ is definitely a programming book, but not one developers only can benefit from.

After an introduction on distributed and queued systems, Dickman describes the architecture of MSMQ -- messages, named queues, routing, security devices -- and touches on the integration between MSMQ and other queue servers. He then turns his attention to purely programming topics and presents a demo and simple application written using both COM objects and the MSMQ API. Once you've seen MSMQ in action and understand its capabilities, the book provides some design considerations, particularly targeted to software architects. Dickman then takes the demo application and discusses how you can make it more reliable and secure by using message properties and formats. He covers message tracking, journaling, and security facilities. The latter parts of the book are dedicated to transaction processing, followed by an appendix with the MSMQ COM and API reference.

Designing Applications With MSMQ is not the only book on MSMQ I've read, but it's the first one that specifically covers the argument of MSMQ. If you're interested in MSMQ as just one of the components of your n-tiered distributed system, then you probably need a more DNA-oriented book. However, if you want to delve deep inside MSMQ and queued middleware, this book is an excellent choice because it does a good job balancing strategic vision with technical details.--Dr. Dobb's Electronic Review of Computer Books

Product Details

Publication date:
Addison-Wesley Microsoft Technology Series
Product dimensions:
7.30(w) x 9.10(h) x 0.90(d)

Read an Excerpt


There may be no more fascinating arena to work in these days than the computing industry. We seem to be continually challenged by technological and design revolutions and counterrevolutions, especially in the area of distributed processing. Today software architectures are evolving, and new languages compete for mind share and market acceptance. Processor speeds and network technologies accelerate to accommodate increased distribution.

The world is witnessing several shifts in the way it develops distributed applications.

  • Windows NT is already becoming the middle-tier platform of choice. It will not displace mainframes or UNIX, but we will see its acceptance as a high-performance platform in the next several years.
  • Object-oriented concepts are being adopted within application architectures as they grow to support previously unimaginable degrees of distribution and granularity.
  • Technologies that make distribution possible are setting new standards for ease of use.

Into this space Microsoft has introduced two key technologies: Transaction Server and Message Queue Server. Microsoft Transaction Server (MTS) adds transactions to the object model defined by Microsoft's Component Object Model (COM). Message Queue Server (MSMQ) supports asynchronous transaction processing, whereby applications exchange messages through a message queue. Although less understood by the developers of smaller, two-tier applications, queued messaging has provided the bulk of transaction processing in non-Windows environments for decades.

But MSMQ stands apart from queued messagingtechnologies of the past. It combines the high-performance communications and reliability of mainframe transaction processing technologies with the flexibility of objects and the large-scale distribution of intranets and the Internet.

Great! MSMQ is an exciting new technology. But why would you be interested in this book? Simply stated, this book offers a lot to various groups of readers.

  • Queued messaging and MSMQ are new to Windows developers. This book will help them to design and to develop messaging applications by using Message Queue Server (MSMQ).
  • Distributed transactional, component systems are emerging as the preferred way to implement Internet and intranet systems on Windows and other platforms. MSMQ is presented in that context.
  • Developers are not the only individuals who must venture into the world of distributed transactional components. Executives and midlevel managers also need to understand the benefits and issues associated with distributed processing and transaction processing (TP).

Although this book has an MSMQ and COM orientation, I have attempted to convey information that is useful outside those contexts. Selected chapters, sections, and paragraphs will be of value to readers who use other messaging environments or other component frameworks.

About This Book

If you are a programmer who will be developing MSMQ applications, I assume that you are proficient in Visual Basic or C/C++. In addition, you should be familiar with Windows as a user. This text does not assume Windows programming knowledge, but that knowledge certainly helps. Also, information systems executives and managers need not be developers to derive value from this book.

This book does not go step by step through MSMQ Enterprise, Site, Server, and Client setup. I discuss design trade-offs in Chapter 2 and demonstrate creation of queues in Chapter 4. However, MSMQ makes setting up an Enterprise, Sites, Servers, and Clients straightforward. It does not warrant duplication here.

This book also ignores the creation of e-mail and connector applications. I would be interested in hearing from readers as to whether they want these or other topics covered in a future release of this book.

Organization of This Book

Chapter 1 tells how queued messaging is similar and different from other forms of communications. Then it describes how MSMQ can be used in two-tier, three-tier, Web, and component architectures. This chapter will be useful to IS executives, development managers, and programmers with limited backgrounds in distributed applications or object-oriented concepts.

MSMQ delivers terrific deployment flexibility and administrative ease of use. These features are highlighted in Chapter 2 as part of a detailed overview of the MSMQ architecture. Level 8 Systems technologies are also described, since most companies will need to integrate non-Windows resources with MSMQ (and vice versa).

Any MSMQ application needs to understand how queues can be configured and messages can be exchanged. In an MSMQ architecture, queues and messages are modeled as objects and have properties associated with them. Chapter 3 introduces queue and message properties. It also describes the kinds of queue names that MSMQ applications must use.

Chapter 4 uses Visual Basic to teach basic queued messaging. In this chapter we implement a version of the well-known Hello World application, using COM components. In Chapter 5 the exercise is repeated, using Visual C++ and the MSMQ (C language) API. COM components can be used in C++ programs and Java applets. (The COM examples contained in Chapter 4 and other chapters could easily be converted to those languages.)

Chapter 6 begins with a critique of the Hello World applications developed in Chapters 4 and 5. Using those applications, we illustrate queue and messaging architectures that satisfy various project goals, requirements, and assumptions.

Several processing scenarios are common in messaging environments. For example, client applications usually need to correlate a request and a response. Also, servers may want to conserve processing resources by triggering processing only when a message is available. These and other processing requirements are implemented in Chapter 7.

One of the differences between queued messaging and on-line kinds of communication, such as remote procedure calls (RPCs), is that they provide much richer failure handling. Messages can be made recoverable and can be copied to journal queues on the source and destination machines. You also have the ability to trace the route that the message takes through a network and can receive acknowledgments that a message reached a receiver or its target queue. Chapter 8 demonstrates how to use these facilities in your program and suggests how they may be used in administrative programs.

MSMQ security is particularly attractive. Chapter 9 discusses MSMQ administrative and programmatic security features. Administrative operations, including configuring access control and auditing, are demonstrated. Program-to-program authentication and message encryption are implemented.

Chapter 10 introduces transaction processing concepts. It begins by describing the value of transaction processing. Atomicity, consistency, isolation, and durability are explained. Then the chapter elaborates on several issues relating to distributed transaction processing. It examines the strengths and weaknesses of on-line distributed transaction processing systems and queued messaging. Compensating transactions and the two-phase commit protocol are also reviewed.

A transactional queued messaging application is developed in Chapter 11. It illustrates how to transactionally send and receive messages, as well as how to combine these operations with other transactional operations, such as database updates.

Appendix A provides a brief reference to COM components and the MSMQ API. Appendix B describes how to set up MSMQ projects in Visual C++ and Visual Basic. MSMQ performance test results are described in Appendix C, and hints are offered.

Gaining Additional Help

The industry is still in the early stages of delivering infrastructures for the development of distributed transactional object systems. Likewise the art of developing distributed transactional object applications is in its infancy. This book attempts to address many basic questions a reader might ask. Complete coverage is a noble goal but is one that no author can hope to achieve.

Luckily resources are available to help you solve your problems. Microsoft does a great job of making its products accessible to users through the Web. You can expect to see Microsoft place white papers on its Web site. Information related to MSMQ can be found at:


What People are Saying About This

Peter Houston
This book is an invaluable resource for learning about MSMQ.

Meet the Author

Alan Dickman is a Chief Technologist at PSW Technologies, the leading provider of software development and systems integration services to the technology industry. He is a recognized industry expert in the design, implementation, and testing of enterprise-wide, three-tier, mission-critical, distributed computing systems. Alan addresses technical audiences worldwide on MSMQ concepts and features and has contributed articles to such publications as Information Week and Patricia Seybold's Distributed Computing Monitor.


Customer Reviews

Average Review:

Post to your social network


Most Helpful Customer Reviews

See all customer reviews