If using the Global PubSub endpoint in a component to running in Cloud Run to Publish to PubSub fails due to an issue in PubSub where the PubSub Control Plane becomes unavailable in that region will the Global Endpoint route the Publish Request to another available region?
If not, what is the advantage of the Global Endpoint if it isn’t able to load balance to another available region? Are there other solutions (other than failing over to a Cloud Run component running in another region to make the Publish Request?).
Below are the details provided in response to your queries:
If using the Global PubSub endpoint in a component to running in Cloud Run to Publish to PubSub fails due to an issue in PubSub where the PubSub Control Plane becomes unavailable in that region will the Global Endpoint route the Publish Request to another available region?
No, if a region goes down, the message will remain unavailable until the region is restored. For instance, if the Pub/Sub servers in the us-central1 regions experience downtime, you won’t be able to publish or subscribe from Pub/Sub since there is no automatic failover to another region.
If not, what is the advantage of the Global Endpoint if it isn’t able to load balance to another available region? Are there other solutions (other than failing over to a Cloud Run component running in another region to make the Publish Request?).
Global endpoints (pubsub.googleapis.com) allows users to interact with the service without specifying a specific region, unlike locational endpoints that require connecting to Pub/Sub in a specific region like us-central1-pubsub.googleapis.com.
You can try locational endpoints as another workaround, you can specify your primary endpoint and fallback Pub/Sub endpoint.
To enhance the reliability of your service, refer to the documentation below for detailed guidance:
@caryna thanks for the reply and clarification. Let me see if I understand what you are saying in terms of my scenario.
Publisher component running in us-west1 (Cloud Run) publishing to PubSub.
Publisher component using the pubsub global endpoint will use the network-nearest region where Pub/Sub runs - (us-west1).
If for some reason, the control plane endpoint in us-west1 is unavailable, the global pubsub endpoint will not provide any load balancer type function and route the publish request to the next nearest available pubsub region.
The Publisher component would need to be configured to connect to locational (region specific) endpoints as primary/failback as necessary to handle pubsub control plane regional failures.
Scenario 1:In case Pub/Sub becomes unavailable in a region, requests originating within the same Google Cloud region are not load balanced to a different region.
Sample: You are using the global endpoint (pubsub.googleapis.com) and us-central is down. If the requests are originating inside us-central1 then they are not load balanced to another region.
Scenario 2:Requests sent to the global endpoint from outside of Google Cloud are routed to a nearby available region. The requests may be routed to a region with insufficient project quota for the request type. The region is also not guaranteed to be the closest geographically.
Sample: You are using the global endpoint (pubsub.googleapis.com) and us-central is down. If the requests are originating outside us-central1 then they will be routed to another nearby available region, but is not guaranteed to be the closest geographically.
Note: You use regional endpoints (locational) if you need strict regional control or specific failover preferences are needed. This offers more control but adds complexity.