0
0
GCPcloud~10 mins

Pub/Sub vs Cloud Tasks in GCP - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Pub/Sub topic named 'my-topic'.

GCP
gcloud pubsub topics create [1]
Drag options to blanks, or click blank then click option'
Amy-queue
Bmy-subscription
Cmy-topic
Dmy-task
Attempts:
3 left
💡 Hint
Common Mistakes
Using a subscription name instead of a topic name.
Confusing Cloud Tasks queue names with Pub/Sub topics.
2fill in blank
medium

Complete the code to create a Cloud Tasks queue named 'my-queue'.

GCP
gcloud tasks queues create [1]
Drag options to blanks, or click blank then click option'
Amy-topic
Bmy-queue
Cmy-subscription
Dmy-topic-queue
Attempts:
3 left
💡 Hint
Common Mistakes
Using a Pub/Sub topic name instead of a queue name.
Using a subscription name in place of a queue.
3fill in blank
hard

Fix the error in the code to publish a message to a Pub/Sub topic.

GCP
gcloud pubsub topics publish my-topic --message=[1]
Drag options to blanks, or click blank then click option'
A'Hello World'
BHello World
CHello_World
D"Hello World"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes causes the message to be split or misinterpreted.
Using single quotes may not work in some shells.
4fill in blank
hard

Fill both blanks to define a Cloud Tasks task with an HTTP request and schedule time.

GCP
gcloud tasks create-http-task --queue=[1] --url=[2] --schedule-time=2024-06-01T12:00:00Z
Drag options to blanks, or click blank then click option'
Amy-queue
Bmy-topic
Chttps://example.com/taskhandler
Dhttps://example.com/publish
Attempts:
3 left
💡 Hint
Common Mistakes
Using a Pub/Sub topic name instead of a queue name.
Using the wrong URL for the task handler.
5fill in blank
hard

Fill all three blanks to create a Pub/Sub subscription with a push endpoint and ack deadline.

GCP
gcloud pubsub subscriptions create [1] --topic=[2] --push-endpoint=[3] --ack-deadline=20
Drag options to blanks, or click blank then click option'
Amy-subscription
Bmy-topic
Chttps://example.com/pushhandler
Dmy-queue
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing queue names with subscription names.
Using the wrong URL for the push endpoint.