GCP - Cloud Pub/Sub
Given the following code snippet, what will be printed if the subscription receives a message?
from google.cloud import pubsub_v1
subscriber = pubsub_v1.SubscriberClient()
subscription_path = subscriber.subscription_path('my-project', 'my-sub')
def callback(message):
print(f'Received: {message.data.decode()}')
message.ack()
streaming_pull_future = subscriber.subscribe(subscription_path, callback=callback)
print('Listening for messages...')
