HOW DATA PROCESSES IN PUB/SUB
HOW DATA PROCESSES IN PUB/SUB
Create a topic:
1. In the google cloud console, navigate to the Pub/Sub topic page.
2. Click create topic and enter a unique name.
Subscribe to the Topic:
1.
Once the Pub/Sub topic is made, add a
subscriber to this. For this navigate to Create subscriptions.
2. Name the created subscription and select one of the options as push or pull and click the create button.
Publish a message to the topic:
To
publish a message to the topic. For the topic that we just created, click on
the Publish a message button and subsequently enter any message in the
message field and then finally, publish it with the help of the add an
attribute button.
Pull the data published:
Finally, execute the
gcloud pubsub subscriptions pull
–auto-ack [SUBSCRIPTION_NAME]
command to pull the data from the
subscription.
The output should then display the message published as follows.
Comments
Post a Comment