
Answer-first summary for fast verification
Answer: Configure the sender application to publish the outgoing emails in a message to a Pub/Sub topic. Update the Cloud Function configuration to consume the Pub/Sub queue.
The issue involves HTTP 500 errors from a third-party email service, leading to potential email loss. Directly invoking the Cloud Function without a resilient queuing mechanism risks losing requests during failures. Option B proposes using Pub/Sub, which decouples the sender and the Cloud Function. Pub/Sub ensures messages are persisted and retried automatically if the function fails, minimizing email loss. Other options are less effective: increasing timeout (A) doesn't address transient failures, Memorystore (C) risks data loss, and aggressive retries (D) may overload systems without guaranteed delivery.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
To handle email delivery more reliably in your Google Cloud microservice-based ecommerce platform after encountering HTTP 500 errors from the third-party email service, what changes should you implement to minimize email loss when the Cloud Function is triggered?
(Include any relevant code corrections if applicable, such as fixing syntax errors in the Cloud Function implementation.)
A
Increase the Cloud Function's timeout to nine minutes.
B
Configure the sender application to publish the outgoing emails in a message to a Pub/Sub topic. Update the Cloud Function configuration to consume the Pub/Sub queue.
C
Configure the sender application to write emails to Memorystore and then trigger the Cloud Function. When the function is triggered, it reads the email details from Memorystore and sends them to the email service.
D
Configure the sender application to retry the execution of the Cloud Function every one second if a request fails.
No comments yet.