Pubsub

  • date 31st May, 2021 |
  • by Prwatech |
  • 0 Comments

Prerequisites

GCP account

Open Console.

Click on Activate Cloud shell

$ gcloud pubsub topics create <topic name>                #Create Topics

$ gcloud pubsub subscriptions create –topic <topic name> <subscription name>                   #Create Subscription

$ gcloud pubsub topics publish <topic name> –message “Welcome to Prwatech”                  #Publish Message

$ gcloud pubsub subscriptions pull –auto-ack <subscription name>                    #Display the subscription

In console, Open Menu > Pub/Sub > Topics

Open the topic which we created.

Click on View Messages.

Select the Created Subscription.

Click Pull.

The message will be displayed.

NB: The validity of one message is 10 seconds. If the message is not displayed, Execute the below command and check it within 10 seconds.

Quick Support

image image