notifications-topic.processNotification triggered by notifications-topic.notifications-topic.processNotification triggered by notifications-topic.notifications-topic using the gcloud command-line tool.Use the gcloud pubsub topics create command followed by the topic name.
processNotification that triggers on the Pub/Sub topic notifications-topic. Use the runtime python39 and specify the entry point as process_notification.Use gcloud functions deploy with the --trigger-topic flag and specify the runtime and entry point.
process_notification that takes event and context parameters and logs the Pub/Sub message data decoded as UTF-8.Use base64.b64decode to decode the message data and print to log it.
main.py containing the process_notification function.Use the --source . flag to specify the current directory containing main.py.
What is the main role of Google Cloud Pub/Sub when integrated with Cloud Functions?
Which of the following is the correct way to specify a Pub/Sub trigger in a Cloud Function deployment command?
gcloud functions deploy myFunction --trigger-?
Given this Cloud Function code triggered by Pub/Sub messages, what will be logged when a message with data "Hello" is published?
def hello_pubsub(event, context):
import base64
message = base64.b64decode(event['data']).decode('utf-8')
print(f"Received message: {message}")What is the likely cause if a Cloud Function triggered by Pub/Sub never runs after publishing messages?
You want to build a system where multiple Cloud Functions react independently to the same Pub/Sub messages. What is the best way to set this up?
Pass the test and this pattern moves unknown