0
0
GCPcloud~10 mins

Why messaging matters in GCP - Test Your Understanding

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'
Adefault-topic
Btopic-1
Ctest-topic
Dmy-topic
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different topic name than 'my-topic'.
2fill in blank
medium

Complete the code to publish a message 'Hello' to the topic 'my-topic'.

GCP
gcloud pubsub topics publish my-topic --message=[1]
Drag options to blanks, or click blank then click option'
A"Hello World"
B"Message"
C"Hello"
D"Hi"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different message text.
Missing quotes around the message.
3fill in blank
hard

Fix the error in the command to subscribe to 'my-topic' with subscription name 'my-sub'.

GCP
gcloud pubsub subscriptions create [1] --topic=my-topic
Drag options to blanks, or click blank then click option'
Amy-sub
Bmy-subscription
Cmy-topic
Dsubscription-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using the topic name as subscription name.
Using a different subscription name.
4fill in blank
hard

Fill both blanks to pull messages from subscription 'my-sub' and acknowledge them.

GCP
gcloud pubsub subscriptions pull [1] --auto-ack --limit=[2]
Drag options to blanks, or click blank then click option'
Amy-sub
B5
C10
Dmy-topic
Attempts:
3 left
💡 Hint
Common Mistakes
Using topic name instead of subscription name.
Using a limit number too large or unrelated.
5fill in blank
hard

Fill all three blanks to create a push subscription named 'push-sub' for topic 'my-topic' with endpoint URL.

GCP
gcloud pubsub subscriptions create [1] --topic=[2] --push-endpoint=[3]
Drag options to blanks, or click blank then click option'
Apush-sub
Bmy-topic
Chttps://example.com/push
Dmy-sub
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing subscription and topic names.
Using invalid or missing endpoint URL.