Web services reliable messaging overview

The Web Services Reliable Messaging (WSRM) specification defines an interoperable protocol to reliably transmit messages from a source to a destination.

When WSRM is implemented, the message source (sender) is called the reliable messaging source and the destination (receiver) is called the reliable message destination. WSRM enables a reliable messaging source (RM source) to transmit a message accurately and reliably as required by the reliable message destination (RM destination). WSRM allows the reliable message destination to resolve any in-doubt status regarding the receipt of the message. Additionally, WSRM enables an RM destination to detect duplicate messages (caused by retransmission of a message by the RM source because of an unacknowledged message) based on RM sequence identifier and MessageId parameters in a message. In AS4 Microservice WSRM is supported for only for one-way push message exchange with split and join enabled.

The following delivery assurance assertions are defined in WSRM specification:
  • AtleastOnce
  • AtMostOnce
  • ExactlyOnce
  • InOrder
Currently, ExactlyOnce delivery is supported in AS4 Microservice.

You can enable WSRM in the conformance policy that is used for message exchange and configure WSRM settings using the related system properties.

By default, Websphere Extreme Scale (WXS) is used to store the WSRM messages. If required, you can add the IN_MEMORY_WSRM_INBOUND and IN_MEMORY_WSRM_OUTBOUND properties to the system properties file to use the local in-memory storage. When WXS is used, you can send sequence messages to different nodes in a collective.
Note: The properties are not available by default. The system honors the properties when you add them to the system properties file.

When WSRM is enabled, and a message is lost in network during transmission, WSRM retry settings that are specified in the system properties file are considered for resending the message. For other scenarios, such as trading partner system down or not available, and SOAP fault in response, store and forward retry settings are considered for resending the message.

Reliable messaging sample flow

The following list explains a sample reliable messaging flow:
  1. The protocol preconditions, which include policy exchange, endpoint resolution, and trust establishment are completed according to conformance policy and exchange profile settings.
  2. The RM source requests creation of a new sequence.
  3. The RM destination creates a new sequence and returns its unique Identifier.
  4. The RM source begins transmitting messages in the sequence beginning with MessageNumber=1. In following image, the RM source sends three messages in the sequence.
  5. The second message in the sequence is lost in transit.
  6. The third message is the last in this sequence and the RM source includes an AckRequested header to ensure that it gets a timely SequenceAcknowledgement for the sequence.
  7. The RM destination acknowledges the receipt of the first and the third message after receiving the AckRequested header from the RM source.
  8. The RM source retransmits the unacknowledged message with MessageNumber=2. This is a new message from the underlying transport perspective, but the message has the same sequence Identifier and MessageNumber, so that the RM destination can recognize the message as a duplicate of the earlier message, in case both the original and retransmitted messages are received. The RM source includes an AckRequested header in the retransmitted message so the RM destination expedites an acknowledgement.
  9. The RM destination receives the second transmission of the message with MessageNumber=2 and acknowledges receipt of all the three messages.
  10. The RM source receives the acknowledgement and sends a TerminateSequence message to the RM destination indicating that the sequence is completed. The TerminateSequence message indicates that the third message was the last message in the sequence. The RM destination then reclaims any resources that are associated with the sequence.
  11. The RM destination receives the TerminateSequence message indicating that the RM source will not send any more messages. The RM destination sends a TerminateSequenceResponse message to the RM source and reclaims any resources that are associated with the sequence.
The following graphic illustrates the sample message exchange between a reliable messaging source and reliable messaging destination.
Graphic illustrating WSRM flow.