0
0
GCPcloud~10 mins

Topics and subscriptions in GCP - Interactive Code 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-subscription
Bmy-topic
Csubscription-1
Dtopic-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using a subscription name instead of a topic name
Using a different topic name
2fill in blank
medium

Complete the code to create a subscription named 'my-subscription' for the topic 'my-topic'.

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

Fix the error in the command 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'
B"Hello"
CHello
Dhello
Attempts:
3 left
💡 Hint
Common Mistakes
Including quotes around the message
Using lowercase message when case matters
4fill in blank
hard

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

GCP
gcloud pubsub subscriptions pull [1] --auto-ack --limit=[2]
Drag options to blanks, or click blank then click option'
Amy-subscription
B5
Cmy-topic
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using topic name instead of subscription
Using a non-numeric value for limit
5fill in blank
hard

Fill all three blanks to create a push subscription named 'push-sub' for topic 'my-topic' with endpoint 'https://example.com/push'.

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-subscription
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing subscription and topic names
Using incorrect URL format