In some situations, the WS-ReliableMessaging
implementation can recover from a sequence-related fault, so your
application can continue without having to process the fault itself.
Your application must still process the fault if the recovery fails.
When a server receives
a request on a reliable messaging sequence that is no longer available
for processing messages, a SOAP fault is produced. If the fault contains
one of the following fault codes, and the message exchange pattern
is asynchronous or synchronous one-way, the runtime environment creates
a new sequence to the same endpoint and resends any messages that
were due for delivery on the original sequence:
- wsrm:SequenceTerminated
- wsrm:MessageNumberRollover
- wsrm:UnknownSequence
These
fault codes are contained in a wsrm:FaultCode element, within a wsrm:SequenceFault
element in the SOAP header.
Any future messages to the target
endpoint are also sent on the new sequence.
If the creation
of the new sequence fails, the original fault is returned to the client.
The client application must detect the fault and create a new sequence,
by using the WS-ReliableMessaging system programming interfaces (SPIs),
to resend the message.
If your application uses asynchronous
messaging, responses from the provider to the client might also be
reallocated in this way. Sequence reallocation does not occur when
the message exchange pattern is synchronous two-way.
Note: Both
the original sequence and the new sequence are visible in the administrative
console panels. Do not delete the original sequence; it is automatically
deleted after 12 hours. If you delete the original sequence while
the new sequence is in use, messages can no longer be sent on the
new sequence.