下面显示的是英文原文。
endpoint
endpoint names another Pub/Sub endpoint, such as a locational endpoint that keeps every request of the service in one region.
By default the broker reaches the global endpoint, https://pubsub.googleapis.com.
A locational endpoint, such as https://us-east1-pubsub.googleapis.com, routes every request to that region.
Two Pub/Sub guarantees hold only inside one region.
Messages that share an ordering key arrive in order when they are published to the same region.
An exactly-once subscription guarantees one delivery to subscribers that connect in the region of the subscription.
The endpoint applies to every client of the broker: subscriptions, publishers and the topology calls at startup.
The AsyncAPI server reports the endpoint's host.
Example
Every request of the service goes to us-east1.
- Macros
- Manual
/// The regional endpoint of `us-east1`: every request of the service goes to that region.
fn regional() -> PubSubBroker {
PubSubBroker::new("my-project").endpoint("https://us-east1-pubsub.googleapis.com")
}
/// The regional endpoint of `us-east1`: every request of the service goes to that region.
fn regional() -> PubSubBroker {
PubSubBroker::new("my-project").endpoint("https://us-east1-pubsub.googleapis.com")
}