Out-of-order messages
In addition to duplicate messages, assume that Cloud Pub/Sub messages will arrive out of order. Rather than preserving order, Cloud Pub/Sub optimizes message delivery speed, with a preference for delivering older messages first. The frequency of out-of-order messages varies based on message volume and the number of concurrent processes pulling messages from a subscription and message buffering. In no circumstances are out-of-order messages entirely avoidable. To deal with this, subscribers should be designed to tolerate out-of-order messages. For example, if a customer updates their order shortly before cancelling it, the loyalty program should anticipate that the order-updated message may arrive after the order-cancelled ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access