Pub/Sub Ordering and Multi-Region

Viewed 546

While searching for the ordering features of Pub/Sub I stumbled upon the fact that ordering is preserved on the same region. Supposing I have ordered Pub/Sub subscriptions outside of GCP. Each subscription is on a different Datacenter on a Different Provider on another Region. How can I specify that those subscriptions will consume from a specific region? Is there an option on an ordered subscription to specify a region? If not then how Pub/Sub decides which region my application is located since it is provisioned in another datacenter, on another provider. Is the region assigned going to change?

1 Answers

The ordering is preserved on the publish side only within a region. In other words, if you are publishing messages to multiple regions, only messages within the same region will be delivered in a consistent order. If your messages were all published to the same region, but your subscribers are spread across regions, then the subscribers will receive all messages in order. If you want to guarantee that your publishes all go to the same region to ensure they are in order, then you can use the regional service endpoints.

Related