Return to Home Page

The public review of the manuscript for "SOA Design Patterns" has concluded !
Thank you to all that participated. 234 reviews were received and over 30 new patterns have been contributed,
increasing the size of this book by over 50%. The second draft of the manuscript is currently in development.

About the Public Review
    History
    Podcasts (audio)
    Notification
    Submit Feedback
    Contribute a Proven Pattern
    Contribute a Candidate Pattern
    Acknowledgements
    Press Release

Introduction to SOA Types & Design Patterns
    The Architecture of
Service-Orientation
    Understanding SOA
Design Patterns

SOA Design Patterns
    Basic Service Inventory Design Pattern Language
    Architectural Design Patterns
    Basic Service Design
Pattern Language
    Service Design Patterns
    Common Compound
Design Patterns

Additional Resources
    View Entire TOC
    Symbol Legend
    Master Pattern List
(by category)
    Candidate Design Patterns
    Design Patterns Publications
    Download SOA Principles Poster (PDF)

About the Book



SOA Design Patterns
by Thomas Erl

For more information visit: www.soapatterns.com

Related Publications


Read the article "Introducing SOA Design Patterns" from the
June 2008 SOA World Magazine (High-Res PDF).

PLEASE NOTE

The content on this page is from the first draft of the manuscript for the upcoming book "SOA Design Patterns" by Thomas Erl. This version of the manuscript was authored in September, 2007. Since then, the manuscript has undergone significant content and structural changes as a result of an industry-wide review in which hundreds of SOA practitioners participated in addition to SOA vendors and experts from the design patterns community.

You are welcome to use the information on this page for research purposes, but you should assume that most of it will change in the final release of the "SOA Design Patterns" book.

Note also, that as a result of an industry-wide call for participation from December 2007 to February 2008, over 30 new design patterns have been contributed to this book. As they become finalized and are incorporated by the author, concise descriptions will be published on this site, and full descriptions with examples will be made available in the final, printed book.

Due to the volume of new content and changes, the release of the "SOA Design Patterns" book has been postponed to October, 2008. To learn more about the book, visit www.soapatterns.com. To be notified of updates to this site, use the notification form.

Chapter 6: Architectural Design Patterns

Home > Chapter 6 Overview > Reliable Messaging
Reliable Messaging

Reliable Messaging

How can a service communicate reliably with consumers when implemented in an unreliable environment?

Problem

Message delivery cannot be guaranteed in service data exchanges carried out using unreliable messaging protocols, which can compromise composition stability.

Solution

An intermediate reliability mechanism is introduced into the environment ensuring that the success or failure of each message delivery is acknowledged.

Application

Middleware and service agents are deployed to keep track of message deliveries and manage the issuance of positive and negative acknowledgements. Rules can be further added to customize behavior during failure conditions.

Impacts

Using a reliability framework adds processing overhead that can affect service activity performance. It also increases composition design complexity and may not be compatible with atomic transaction requirements.

Principles

Service Composability

Architecture

Inventory, Composition

Table 6.20 – Profile summary for the Reliable Messaging pattern.

Problem

When services are designed to communicate via messages, there is a natural loss of quality of service due to the stateless nature of messaging protocols, such as HTTP. Unlike with binary communication protocols where a persistent connection is maintained until the data transmission between a sender and receiver is completed, with message exchanges the runtime platform may not be able to provide feedback to the sender as to whether or not a message was successfully delivered.

The probability of failure is exacerbated as the service count (and the number of corresponding network links) grows with service compositions increasing in size and complexity. 

Figure 6.87 – During the course of a regular message exchange, there are no guarantees. Various runtime conditions may cause the message delivery to fail.

Solution

The inventory architecture is equipped with a reliability framework that tracks and temporarily persists message transmissions, and issues positive and negative acknowledgements to communicate successful and failed transmissions to message senders.

Application

An middle tier providing the reliability framework is incorporated into the inventory architecture, comprised of a series of runtime service agents that participate in the messaging chain between senders and receivers.

This framework can store messages in transit via a persistent repository (which is often memory-based), as a back-up mechanism for when message transmissions fail. This central storage also eases the management and administration of service-oriented solutions because it allows administrators to track the status of messages and trace the causes behind unresolved delivery problems.

The reliability agents further manage the confirmation of successful and failed message deliveries via positive (ACK) and negative (NACK) acknowledgement notifications, as demonstrated in Figure 6.x. Messages may be transmitted and acknowledged individually or they may be bundled into message sequences that are acknowledged in groups (and may also have sequence-related delivery rules).

Figure 6.88 – A common example of the mechanics behind a reliable messaging framework. The consumer sends a request message (1) and the message is then copied into persistent storage by intermediary service agents (2). An acknowledgement notification is sent back to the consumer (3) and the intermediary agents then deliver the message to the service. The service responds with an acknowledgement notification, allowing the intermediary agents to remove the message from persistent memory.

Note: During the exchange illustrated in Figure 6.x, should the consumer or the agents not receive an acknowledgement message within a given timeout period, they may be required to resend the message. There are various rules (often referred to as quality assurances) that can be applied to customize retransmission scenarios.

Impacts

Reliable Messaging introduces a layer of processing that includes runtime message capture, persistence, tracking, and acknowledgement notification issuance. All of these features add moving parts to an inventory architecture that demand additional performance requirements and increase the complexity of service-oriented solutions proportional to the size of service compositions.

Furthermore, due to the temporary storage of messages, the incorporation of positive and negative acknowledgement notifications, and the use of various delivery rules (including those based on group message delivery via sequences), it may not be possible to wrap services using reliability features into atomic transactions, as per the Cross-Service Transaction pattern.

Relationships

Applying this pattern directly affects messaging-related patterns in that it changes how messages are transmitted and delivered. The quality of Service Messaging is improved and Messaging Metadata is commonly utilized to manage and track messages via reliability agents. These agents comprise the bulk of a reliability framework and can be considered specialized implementations of the Service Agent pattern. Considerations arise from the application of Canonical Resources can help ensure that an inventory architecture standardizes on a single reliability framework.

Figure 6.89 – The messaging-centric focus of this pattern makes it naturally affect other messaging-related patterns.

Because of the importance of guaranteeing message delivery and improving the overall QoS of base messaging frameworks, the runtime functionality established by applying Reliable Messaging pattern is common to many ESB platforms (Figure 6.x).

Figure 6.90 – The Reliable Messaging pattern can be applied by itself, but is also a pattern that can be realized via the Enterprise Service Bus compound pattern (as explained in Chapter 9).

Case Study Example

Case study content is not available on this Web site.

Prev | Next
The Prentice Hall Service-Oriented Computing Series from Thomas Erl
Home    SOA Books    SOA Magazine    What is SOA?    SOA Principles    SOA Methodology    SOA Glossary Copyright © 2007-2008
SOA Systems Inc.