Accessing Pub/Sub from
the command line.
- ## list all topics
- $ gcloud pubsub topics list
- ## Create new topics
- $ gcloud pubsub topics create topicName
- ## delete existing topics
- $ gcloud pubsub topics delete topicName
- ## Create subscription for topics
- $ gcloud pubsub subscriptions create --topic topicName subscribtionName
- ## list all subscription for all the topics
- $ gcloud pubsub subscriptions list
- ## list all subscription for specific topics
- $ gcloud pubsub topics list-subscriptions topicName
- ## Publish a message
- $ gcloud pubsub topics publish topicName --message "message"
- ## publish top available messages for subscriptions
- $ gcloud pubsub subscriptions pull subscriptionName --auto-ack
- ## publish a few available messages for subscriptions
- $ gcloud pubsub subscriptions pull subscriptionName --auto-ack --limit=3
- ## Delete the topic
- $ gcloud pubsub topics delete topicName
- ## Delete the subscriptions
- $ gcloud pubsub subscriptions delete SubscriptionName
No comments:
Write commentsPlease do not enter spam links