Accessing GCP Pub/Sub from the command line.

 



Accessing Pub/Sub from 


the command line.


  1. ## list all topics
    • $ gcloud pubsub topics list
  2. ## Create new topics
    • $ gcloud pubsub topics create topicName
  3. ## delete existing topics
    • $ gcloud pubsub topics delete topicName
  4. ## Create subscription for topics
    • $ gcloud pubsub subscriptions create --topic topicName subscribtionName
  5. ## list all subscription for all the topics
    • $ gcloud pubsub subscriptions list
  6. ## list all subscription for specific topics
    • $ gcloud pubsub topics list-subscriptions topicName
  7. ## Publish a message
    • $ gcloud pubsub topics publish topicName --message "message"
  8. ## publish top available messages for subscriptions
    • $ gcloud pubsub subscriptions pull subscriptionName --auto-ack
  9. ## publish a few available messages for subscriptions
    • $ gcloud pubsub subscriptions pull subscriptionName --auto-ack --limit=3
  10. ## Delete the topic
    • $ gcloud pubsub topics delete topicName
  11. ## Delete the subscriptions
    • $ gcloud pubsub subscriptions delete SubscriptionName

No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services