3.1.5.1.9.1 Deleting Acknowledged Messages
The protocol MUST locate the Stream element that corresponds to the incoming final stream receipt by selecting it from SRMPState.StreamCollection, where Stream.Id equals the <streamId> element in the <streamReceipt> element. If no such Stream element can be found, the protocol MUST discard the final stream receipt message and perform no further action.
The protocol MUST dereference the Stream.OutgoingQueueReference to find the OutgoingQueue that contains the stream messages that are acknowledged by the incoming stream receipt.
The protocol MUST identify the message from the OutgoingQueue where:
The SRMPMessage.TransactionalMessageSequenceIdentifier element equals the substring of the <streamId> element in the <streamReceipt> element directly following the "\" character.
The SRMPMessage.TransactionSequenceNumber is equal to the <lastOrdinal> element in the <streamReceipt> element.
If no such message can be found, the protocol MUST discard the final stream receipt message and perform no further action.
The protocol MUST delete the identified message from the OutgoingQueue by raising a Message Position Deleted event as defined in [MS-MQDMPR] section 3.1.7.2.1 with the following arguments:
iQueue: A reference to the OutgoingQueue.
iPosition: The MessagePosition of the identified message.
iReason: AckReceive ([MS-MQDMPR] section 3.1.1.12).
The protocol MUST raise a Stream Element Removed Event (section 3.1.7.6) with the following argument:
iQueue: A reference to the OutgoingQueue.