Google Professional Data Engineer

Google Professional Data Engineer

Get started today

Ultimate access to all questions.


You are tasked with designing a messaging system using Google Cloud Pub/Sub to process clickstream data. The system incorporates an event-driven consumer application that operates using a push subscription. To account for potential temporary downtime of the consumer application, you need to ensure that the messaging system is robust and reliable. Additionally, the system must store incoming messages that are not immediately consumable by the subscriber. It should also implement a retry mechanism for failed messages, with retries spaced out to prevent overloading the consumer application. After a maximum of 10 retries, any failed messages should be stored in a designated topic. How should you configure the Pub/Sub subscription to meet these requirements?




Explanation:

Option D is the correct answer. Using exponential backoff as the subscription retry policy helps to gradually increase the delay between retries, which prevents overloading the consumer app. Configuring dead lettering to a different topic ensures that messages which cannot be processed after the maximum delivery attempts (10 in this case) are stored separately. This setup allows for effective message retry management and prevents the main message flow from being interrupted by failed messages.