Cloud Pub/Sub is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications.
-
Read Prerequisites and How to run a sample first.
-
Install dependencies:
npm install
View the documentation or the source code.
Usage: node topics --help
Usage: node topics COMMAND [ARGS...]
Commands:
create TOPIC_NAME
delete TOPIC_NAME
publish TOPIC_NAME MESSAGE
list
Examples:
node topics create my-topic
node topics list
node topics publish my-topic '{"data":"Hello world!"}'
node topics delete my-topic
View the documentation or the source code.
Usage: node subscriptions --help
Usage: node subscriptions COMMAND [ARGS...]
Commands:
create TOPIC_NAME SUBSCRIPTION_NAME
delete SUBSCRIPTION_NAME
pull SUBSCRIPTION_NAME
list [TOPIC_NAME]
Examples:
node subscriptions create my-topic my-subscription
node subscriptions delete my-subscription
node subscriptions pull my-subscription
node subscriptions list
node subscriptions list my-topic
View the documentation or the source code.
Usage: node iam --help
Usage: node iam RESOURCE COMMAND [ARGS...]
Resources:
topics
subscriptions
Commands:
get NAME
set NAME
test NAME
Examples:
node iam topics get my-topic
node iam topics set my-topic
node iam topics test my-topic
node iam subscriptions get my-subscription
node iam subscriptions set my-subscription
node iam subscriptions test my-subscription