Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/subscriber/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ to subscribe to, and it must already exist. Once you have that, it is easy:

# Substitute PROJECT, SUBSCRIPTION, and TOPIC with appropriate values for
# your application.

# from google.cloud import pubsub
# publisher = pubsub.PublisherClient()

topic_path = publisher.topic_path(PROJECT, TOPIC)
sub_path = subscriber.subscription_path(PROJECT, SUBSCRIPTION)
topic_path = subscriber.topic_path(PROJECT, TOPIC)
subscriber.create_subscription(request={"name": sub_path, "topic": topic_path})

Once you have created a subscription (or if you already had one), the next
Expand Down