Overview of Web Services Reliable Messaging
Posted by bhaktimehta on March 31, 2006 at 4:08 PM EST
Consequently, messages can be lost or delivered out of order. Web Services Reliable Messaging (WS RM) provides
a mechanism to ensure a layer of reliability between potentially unreliable or intermittently connected networks.
It provides an interoperable protocol that a RM (Reliable Messaging) Source and RM Destination use to provide
Application Source and Destination a guarantee that the message that is sent will be delivered.
This guarantee is known as delivery assurance.
There are four basic delivery assurances that endpoints can provide
AtMostOnce:
Messages will be delivered at most once without duplication . It is possible some messages in a sequence may not be
delivered.
AtLeastOnce:
Every message sent will be delivered. Some messages may be delivered more than once.
ExactlyOnce :
Every message sent will be delivered without duplication.
InOrder:
Messages will be delivered in the order that they were sent.
| WS RM is one of the enterprise features in Project Tango which is Sun's Java Web Services interoperability project with Microsoft's Windows Communication Foundation (WCF). | ![]() |
will provide configurable settings to easily enable RM in endpoints as shown in the screen shot below.

Fig 1 Screenshot of how to configure WS RM for an endpoint using Netbeans
Programming Model for Tango
- Developer writes Producers/Consumers using JAX-WS 2.0 apis.
- Developer/Deployer supplies config files which would be wsdls containing Policy assertions to enable/control Tango components.
- Config file can be written by hand or easily produced by Tango Netbeans Module as shown in Fig 1.

Fig 2 Message exchange when RM is enabled using WS RM implementation
The above figure shows how the Client or Application Source sends a message for reliable delivery.
When RM is enabled, Project Tango's RM Source module is plugged into the JAX-WS remoting system.
The RM Source module keeps copies of messages until their receipt is acknowledged (via the exchange of protocol
messages). Similarly, an RM Destination module acknowledges messages (and may buffer them for order guarantees).
After guaranteeing order (if ordering enabled), the RM Destination allows the message to proceed through the
JAX-WS dispatch for delivery to the Endpoint or Application Destination.
Protocol Messages

Fig 3 Possible application and protocol message exchanges between RM endpoints
The above figure shows how the message exchange takes place between two reliable messaging endpoints
once the initial preconditions are established such as resolving endpoint references, policy exchange and establishing trust.
- The RM Source requests creation of a new Sequence by initiating a
CreateSequence/CreateSequenceResponse handshake.
- The RM Destination creates the Sequence by returning a
CreateSequenceResponse
with globally unique identifier.This sequence id would be used to identify
the sequence and will be sent in all the following messages.
- The RM Sources begins sending messages with MessageNumber 1 .
- After 3 messages it sends LastMessage token.
- The 2nd message is lost in transit
- The RM Destination acknowledges receipt of message numbers 1 and 3 in response to LastMessage.
- The RM Source retransmits 2nd message which has the same sequence
identifier
and message number so that the RM Destination can recognize it as equivalent of earlier message.
The RM Source also includes an AckRequested so RM Destination can expedite the acknowledgement. - RM Destination receives the second transmission and acknowledges the receipt of messages 1,2 ,3.
- The RM Source receives the acknowledgement and sends Terminate
Sequence to RM Destination.
The RM Destination receives TerminateSequence and reclaims resources associated with the Sequence
Availability
The implementation will be available by JavaOne on Java.net with support for Glassfish and Netbeans IDE.
Plugfest Status
We tested our WS RM implementation with Microsofts WCF at the Plugfest on March 7-9 at Redmond.
We successfully interoperated in the ReliableOneWay and ReliableRoundrip scenarios both as clients and endpoints.
JavaOne 2006
For more information be sure to check out the session on
Reliable and Transacted Web Services between Javaâ„¢ Technology-Based Project Tango and Microsoft Indigo TS-1603.
Other information
WS-ReliableMessaging specification
WS-RM Policy Assertion
Related Topics >>
Blog Links >>
- Login or register to post comments
- Printer-friendly version
- bhaktimehta's blog
- 1594 reads






