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.
- AtleastOnce
- AtMostOnce
- ExactlyOnce
- InOrder
You can enable WSRM in the conformance policy that is used for message exchange and configure WSRM settings using the related system properties.
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 protocol preconditions, which include policy exchange, endpoint resolution, and trust establishment are completed according to conformance policy and exchange profile settings.
- The RM source requests creation of a new sequence.
- The RM destination creates a new sequence and returns its unique Identifier.
- 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. - The second message in the sequence is lost in transit.
- The third message is the last in this sequence and the RM source
includes an
AckRequested
header to ensure that it gets a timelySequenceAcknowledgement
for the sequence. - The RM destination acknowledges the receipt of the first and the
third message after receiving the
AckRequested
header from the RM source. - 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 sequenceIdentifier
andMessageNumber
, 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 anAckRequested
header in the retransmitted message so the RM destination expedites an acknowledgement. - The RM destination receives the second transmission of the message
with
MessageNumber=2
and acknowledges receipt of all the three messages. - The RM source receives the acknowledgement and sends a
TerminateSequence
message to the RM destination indicating that the sequence is completed. TheTerminateSequence
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. - The RM destination receives the
TerminateSequence
message indicating that the RM source will not send any more messages. The RM destination sends aTerminateSequenceResponse
message to the RM source and reclaims any resources that are associated with the sequence.
