Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Labs

Utilizing Google Cloud Pub/Sub

Cloud Pub/Sub is Google Cloud's central fully managed messaging service. Being central, it is consequently incorporated in a lot of different workflows. Pub/Sub can be used to stream data to BigQuery, Cloud Functions, Stackdriver, Cloud IoT Core, and numerous other services. This hands-on lab will provide you with practical experience working with the necessary components of Cloud Pub/Sub: topics, subscriptions, and messages.

Lab platform
Lab Info
Level
Beginner
Last updated
Sep 23, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Enable APIs
    1. From the main console navigation, go to APIs and Services > Library.
    2. Search for Pub/Sub.
    3. Select the Cloud Pub/Sub card.
    4. Click Enable, if displayed.
  2. Challenge

    Create a Topic
    1. From the main navigation, go to Pub/Sub > Topics.
    2. Click Create a topic.
    3. Enter a name for the topic (e.g., "acg-topic-1").
    4. Deselect Create a default subscription.
    5. Click Create.
  3. Challenge

    Create a Subscription
    1. Drill down into the topic just created and choose Subscriptions.
    2. Click the icon in the Topic details navigation bar to create a subscription.
    3. Enter a name for the subscription (e.g., "acg-sub-1").
    4. Set Delivery Type to Pull.
    5. Leave the rest of the settings at their defaults.
    6. Click Create.
  4. Challenge

    Publish a Message
    1. From the Topic details page, click Publish Message.
    2. Enter a message in the Message field.
    3. Click Publish.
  5. Challenge

    Retrieve Message
    1. Activate the Cloud Shell by clicking its icon in the top row.

    2. If the Cloud Shell does not display the current project ID in yellow, open the Project panel by clicking the project name in the upper-left.

    3. Copy the current project ID.

    4. In the Cloud Shell, enter the following command:

      gcloud config set project <PROJECT_ID>
      
    5. To retrieve a message, enter the following command:

      gcloud pubsub subscriptions pull <SUBSCRIPTION_NAME> --auto-ack
      
    6. Confirm the message displayed is the same as published.

    7. Repeat the command again.

    8. Confirm zero messages are found.

  6. Challenge

    Publish Multiple Messages
    1. From the Topic details page, click Publish Message.
    2. Enter a message in the Message field.
    3. Click Publish.
    4. Repeat steps 1-3 twice more.
  7. Challenge

    Retrieve Multiple Messages
    1. In the Cloud Shell, enter the following command:

      gcloud pubsub subscriptions pull <SUBSCRIPTION_NAME> --auto-ack --limit=3
      
    2. Confirm all messages displayed are the same as were published.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight