namespace pubsub = ::google::cloud::pubsub;
using ::google::cloud::Options;
[](std::string const& project_id, std::string const& subscription_id) {
// This service supports specifying a regional or locational endpoint prefix
// when creating the SubscriptionAdminConnection.
// For example, to connect to "europe-central2-pubsub.googleapis.com":
auto sub = pubsub::Subscriber(pubsub::MakeSubscriberConnection(
"europe-central2", pubsub::Subscription(project_id, subscription_id)));
// This configuration is common with Private Google Access:
// https://cloud.google.com/vpc/docs/private-google-access
auto vpc_sub = pubsub::Subscriber(pubsub::MakeSubscriberConnection(
pubsub::Subscription(project_id, subscription_id),
Options{}.set<google::cloud::EndpointOption>(
"private.googleapis.com")));
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-12 UTC."],[[["The latest version available is 2.37.0-rc, which can be accessed via the provided link."],["The page lists multiple previous versions of the software, spanning from 2.36.0 down to 2.11.0."],["Each version listed has a corresponding link leading to the \"Subscriber-endpoint-snippet\" documentation for that release."],["The example code demonstrates how to override the default subscriber endpoint to `private.googleapis.com` within the `pubsub` namespace."],["All listed versions pertain to the C++ documentation under the topic of pub/sub."]]],[]]