Skip to content

Commit

Permalink
Explained topic and subscription path methods
Browse files Browse the repository at this point in the history
  • Loading branch information
anguillanneuf committed Oct 12, 2018
1 parent c52c361 commit 2f7633b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pubsub/cloud-client/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def publish_messages(project_id, topic_name):
# TODO topic_name = "Your Pub/Sub topic name"

publisher = pubsub_v1.PublisherClient()
# The `topic_path` method creates a fully qualified identifier for
# the topic in the form `projects/{project_id}/topics/{topic_name}`
# The `topic_path` method creates a fully qualified identifier
# in the form `projects/{project_id}/topics/{topic_name}`
topic_path = publisher.topic_path(project_id, topic_name)

for n in range(1, 10):
Expand Down
2 changes: 2 additions & 0 deletions pubsub/cloud-client/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ def receive_messages(project_id, subscription_name):
# TODO subscription_name = "Your Pub/Sub subscription name"

subscriber = pubsub_v1.SubscriberClient()
# The `subscription_path` method creates a fully qualified identifier
# in the form `projects/{project_id}/topics/{subscription_name}`
subscription_path = subscriber.subscription_path(
project_id, subscription_name)

Expand Down

0 comments on commit 2f7633b

Please sign in to comment.