Google Cloud Professional Data Engineer — Question 208

You are designing a messaging system by using Pub/Sub to process clickstream data with an event-driven consumer app that relies on a push subscription. You need to configure the messaging system that is reliable enough to handle temporary downtime of the consumer app. You also need the messaging system to store the input messages that cannot be consumed by the subscriber. The system needs to retry failed messages gradually, avoiding overloading the consumer app, and store the failed messages after a maximum of 10 retries in a topic. How should you configure the Pub/Sub subscription?

Answer options

Correct answer: D

Explanation

Option D is correct because it uses exponential backoff for retries, which helps to prevent overload on the consumer app, and it ensures that failed messages are dead-lettered to a different topic after 10 attempts. Option A does not address the retry mechanism or dead lettering. Option B uses immediate redelivery, which may overwhelm the consumer app, and it also incorrectly suggests using a different topic for dead lettering without a backoff strategy. Option C fails to utilize a separate topic for dead lettering, which is necessary for proper error handling.