php-docs-samples icon indicating copy to clipboard operation
php-docs-samples copied to clipboard

Pub/Sub: distinguish resource names and resource IDs

Open anguillanneuf opened this issue 3 years ago • 1 comments

Samples should refer to the fully qualified topic paths projects/{}/topics/{} as topic names and the actual string for the topic as the topic id.

The same goes for subscriptions.

For example, this should be $topic = $pubsub->topic($topicId);. https://github.com/GoogleCloudPlatform/php-docs-samples/blob/906d56f233954dfcaa47237d491851234608257c/pubsub/api/src/publish_message.php#L42

anguillanneuf avatar Jan 26 '21 00:01 anguillanneuf

Hi @anguillanneuf I know this issue was filled a while ago, but can you mention why is it important to use the fully qualified names instead of the friendly names?

I think the user would be more comfortable in using the topicName instead of the topicId. Moreover, when I checked this, there are other clients which seem to be using the topicName as well.

saranshdhingra avatar May 12 '22 09:05 saranshdhingra