Home > Store

Designing Applications with MSMQ: Message Queuing for Developers

Register your product to gain access to bonus material or receive a coupon.

Designing Applications with MSMQ: Message Queuing for Developers

Book

  • Sorry, this book is no longer in print.
Not for Sale

Description

  • Copyright 1998
  • Dimensions: 7-3/8" x 9-1/4"
  • Pages: 392
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-32581-0
  • ISBN-13: 978-0-201-32581-2

"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.



0201325810B04062001

Downloads

Source Code

Click below for Source Code related to this title:
Source Code

Sample Content

Table of Contents



1. Distributed Architectures and Microsoft Message Queue Server (MSMQ).

Introduction to MSMQ Application Architectures.

Using MSMQ in Well-Known Distributed Application Architectures.

The Future of MSMQ.

Conclusion.

Resources and References.



2. Overview of MSMQ Architecture and Features.

Selected Definitions.

Programming Interfaces.

Messages and Message Queues.

Sending and Receiving Messages.

MSMQ Architecture.

Integration with non-MSMQ Messaging Environments.

Conclusion.

Resources and References.



3. Properties and Queue Names.

Properties.

Queue Naming.

Conclusion.

Resources and References.



4. An MSMQ Application Using the COM Components.

Overview of Hello World.

MSMQ COM Components.

Queue Creation.

Locating Queues.

Creating the Hello World Sender Form.

Opening Queues and Sending Messages.

Receiving Responses.

Closing Queues.

The Hello World Receiver.

Summary.

Resources and References.



5. An MSMQ Application Using the MSMQ API.

Overview of Hello World.

Working with Properties in the MSMQ API.

Creating Queues.

Locating Queues.

Opening, Closing, and Deleting Queues.

Receiving Messages and Sending a Response.

The Hello World Sender.

Sample Program Output.

Conclusion.

Resources and References.



6. MSMQ Queue and Message Design Considerations.

Hello World Program Analysis.

Queue Options.

Messages and Message Property Options.

Summary.

Resources and References.



7. Solutions to Message Problems.

Converting Message and Correlation IDs to Strings.

Request and Response Correlation.

Asynchronous Message Processing.

Handling Variable-Length Messages.

Multipart Message Sequences.

Object Shipping.

Working While Off Line.

Conclusion.

Resources and References.



8. Improving Message Tracking and Recovery.

Overview of MSMQ Facilities.

Making Messages Recoverable.

Setting Up Message and Queue Journals.

Tracing Message Routing.

Acknowledging Messages.

Recovering and Tracing Messages.

Conclusion.

Resources and References.



9. MSMQ Security.

Authentication.

Message Encryption.

MSMQ Access Controls.

Managing Queue Access Programmatically.

Access Event Auditing.

Conclusion and Recommendations.

Resources and References.



10. Introduction to Transaction Processing.

Basics of Transaction Processing.

The ACID Properties.

Distributed Transaction Processing.

Transactional Queued Messaging.

When to Use On-Line or Queued Transactions.

Conclusions and Recommendations.

Resources and References.



11. Implementing Transactions and Assessing Performance.

Basics of Transactional Messaging.

External Transactions.

Internal Transactions.

In-Order Delivery.

Conclusion.

Resources and References.



Appendix A: COM Component and MSMQ API Reference.

COM Components.

MSMQ API Functions.

Queue and Message Properties.



Appendix B: Configuring Visual C++ and Visual Basic for MSMQ.

Creating and Configuring a Project in Visual C++.

Creating and Configuring a Project in Visual Basic.



Appendix C: MSMQ Performance.

Messaging Performance.



Conclusions and Recommendations.


Index. 0201325810T04062001

Preface

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 messaging technologies 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:

http://www.microsoft.com/ntserver/nts/appservice

PSW Technologies also has several resource pages devoted to MSMQ, transaction processing on Windows NT, and porting applications from UNIX to Windows. Please visit our Web site at:

http://www.psw.com/

For information about connecting MSMQ to non-Windows platforms, visit the Web site of Level 8 Systems for information about their message queuing solutions:

http://www.level8.com/

When all else fails, you can communicate via e-mail. Please address questions to:

alan@tpmg-experts.com

Thanks

Writing a book is challenging and tiring. Above all, it is a humbling experience. I have benefited in so many ways from numerous people.

My book reviewers were terrific. Thanks to Oran Bodner, Ilan Caron, and Alexander Dadiomov at Microsoft, who helped me sort through a lot of technical details. Melodi Gates, Jay Lang, Ken Walker, and Gene Belitski offered great suggestions and practical insights.

Others at Microsoft were very helpful, too! Peter Houston made human and intellectual resources available to me. Amnon Horowitz, Doran Juster, Nir Katz, and Syed Yousef contributed a lot of time. I owe a tremendous debt to Dr. Frank King, as well as to Brian Baisley, Bill Cason, Dennis Thompson, Christine Kungl, Mike McCown and others of PSW Technologies for giving me the time to explore MSMQ and the resources to write. Thanks to Reid Spencer of PSW Technologies for reviewing parts of this book. Also, thanks to several readers of Microsoft's MSMQ newsgroups for sharing their questions and experience.

Special thanks to Carter Shanklin, Elizabeth Spainhour, Genevieve Rajewski, John Fuller, Krysia Bebick, and others who have made working with Addison-Wesley such a pleasant experience.

Finally, my family and friends stayed out of my way when I was working and distracted me when I needed a break.

--Alan Dickman
PSW Technologies, Inc.



0201325810P04062001

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020