Message Ordering Considerations
AMPS uses the name of the publisher and the sequence number assigned by the publisher to ensure that messages from each publisher are delivered to a subscription in order (see the Message Ordering section for more details). However, AMPS does not enforce order across publishers. AMPS also guarantees that the transaction log on each instance is written in the same order in which that instance delivered messages to publishers and that subsequent replays from the transaction log for the instance will reproduce the exact order in which messages were delivered originally.
In a failover situation, messages from different publishers may be interleaved in a different order on different servers, even though the message stream from each publisher is preserved in order. Each instance preserves the order in which messages were processed by that instance and enforces that order.
The AMPS client libraries include bookmark store implementations that are designed to ensure that when a bookmark subscription (that is, a replay from the transaction log) fails over across instances that replicate to each other, a subscription can be resumed without missing messages, even if multiple replicated instances receive publishes and, therefore, have different interleaved order in their transaction logs.
Last updated