From the course: Data Science on Google Cloud Platform: Building Data Pipelines

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Publish and receive

Publish and receive - Google Cloud Tutorial

From the course: Data Science on Google Cloud Platform: Building Data Pipelines

Start my 1-month free trial

Publish and receive

- [Instructor] In this video, I will show you how to publish to a topic through the console, and then how to subscribe and receive data through the g cloud shell. To publish data, go to the topics page for the specific topic you want to publish. Click on the three dots, and choose publish message. A new page will appear. You can provide freeform text in the message. In addition, you can also provide additional attributes. I'm going to provide a message. This is to test Pub/Sub. Then, I will also add an attribute called user and put the name Mike in it. Click on publish, and the message gets published. To pull the message through the subscription, go to the g cloud shell. Remember that you can publish and subscribe through any of the other means, including SDK, REST API, Console, and the g cloud shell. To pull the message, I'm going to use the command gcloud pubsub subscriptions pull, and then I'm going to use auto-acknowledge so that messages, once received, are auto-acknowledged, and…

Contents