Note
Only element descriptions are provided in this section. Concepts relating to WS-ReliableMessaging are covered in Chapter 7.
WS-ReliableMessaging introduces critical quality of service features for the guaranteed delivery or failure notification of SOAP messages. It also positions itself as a fundamental WS-* extension, as shown in Figure 17.2.
Figure 17.2. How WS-ReliableMessaging relates to the other WS-* specifications discussed in this chapter.
When message exchanges are governed by a WS-ReliableMessaging-capable communications framework, the concepts of sequences and acknowledgements become paramount to just about every message transmission.
Coming up are descriptions for the following key WS-ReliableMessaging language elements:
Further supplementing these descriptions is a quick reference table containing brief descriptions of the following additional elements and assertions: SequenceRef, AcknowledgementInterval, BaseRetransmissionInterval, InactivityTimeout, Expires, and SequenceCreation.
17.2.1. The Sequence, MessageNumber, and LastMessage elements
As explained in Chapter 7, the delivery of messages within a WS-ReliableMessaging framework can be guaranteed to occur in a specific order. The Sequence construct resides in the SOAP message header to represent the location of the current message in relation to the overall sequence of messages within which it is being delivered.
To accomplish this, the Sequence construct relies on a set of child elements. The Identifier element is used to contain an ID value associated with the sequence itself, while the MessageNumber element contains a number that is the position of the message within the overall sequence order.
Finally, the LastMessage element can be added to the Sequence construct to communicate the fact that the current message is the final message of the sequence.
17.2.2. The SequenceAcknowledgement and AcknowledgementRange elements
Upon the arrival of one or more messages within a sequence, the recipient service may issue a message containing the SequenceAcknowledgement header construct to communicate that the original delivery was successful. This construct again uses the Identifier element to identify the sequence, but it also needs an element to convey which of the messages within the sequence were received and which were not.
It accomplishes this through the use of the AcknowledgementRange element, which contains the Upper and Lower attributes that indicate a range of messages that were received. This range is based on the MessageNumber values of the messages, which, when they are first generated, are incremented. So one AcknowledgementRange element communicates each consecutive set of messages received. Therefore, a message that is not received is not accounted for within the ranges specified in the AcknowledgementRange elements.
If this sounds a bit confusing, have a look at how the SOAP header is structured in Example 17.6.
17.2.3. The Nack element
Communicating the delivery failure of a message can, alternatively, be accomplished using the Nack (negative acknowledgement) element. Instead of identifying which messages with MessageNumber values were received, it shows which were not.
17.2.4. The AckRequested element
RM destinations typically issue SOAP messages with SequenceAcknowledgement headers at predefined times, such as upon the receipt of a message containing the LastMessage element. However, an RM source service can request that the RM destination send out a sequence acknowledgement message on demand by using the AckRequested header construct.
This construct simply contains a standard Identifier element to pinpoint the sequence for which it is requesting an acknowledgement message. It also can include a MessageNumber element that gives an indication as to which message receipt the RM source is most interested in.
17.2.5. Other WS-ReliableMessaging elements
Table 17.3 provides an overview of additional elements that are part of the WS-ReliableMessaging language.
Element |
Description |
---|---|
SequenceRef |
This construct allows you to attach policy assertions to a sequence, which introduces the ability to add various delivery rules, such as those expressed in the delivery assurances explained in Chapter 7. |
AcknowledgementInterval |
Specifies an interval period that an RM destination can use to automatically transmit acknowledgement messages. |
BaseRetransmissionInterval |
An interval period used by the RM source to retransmit messages (for example, if no acknowledgements are received). |
InactivityTimeout |
A period of time that indicates at what point a sequence will time out and subsequently expire. |
Expires |
A specific date and time at which a sequence is scheduled to expire. |
SequenceCreation |
Sequences are generally created by the RM Source, but the RM Destination may use this element to force the creation of its own sequence. |
SUMMARY OF KEY POINTS |
---|
|
Introduction
Case Studies
Part I: SOA and Web Services Fundamentals
Introducing SOA
The Evolution of SOA
Web Services and Primitive SOA
Part II: SOA and WS-* Extensions
Web Services and Contemporary SOA (Part I: Activity Management and Composition)
Web Services and Contemporary SOA (Part II: Advanced Messaging, Metadata, and Security)
Part III: SOA and Service-Orientation
Principles of Service-Orientation
Service Layers
Part IV: Building SOA (Planning and Analysis)
SOA Delivery Strategies
Service-Oriented Analysis (Part I: Introduction)
Service-Oriented Analysis (Part II: Service Modeling)
Part V: Building SOA (Technology and Design)
Service-Oriented Design (Part I: Introduction)
Service-Oriented Design (Part II: SOA Composition Guidelines)
Service-Oriented Design (Part III: Service Design)
Service-Oriented Design (Part IV: Business Process Design)
Fundamental WS-* Extensions
SOA Platforms
Appendix A. Case Studies: Conclusion