How to configure Pub/Sub retries and dead-lettering?
Short answer
D Use exponential backoff as the subscription retry policy, and configure dead lettering to a different topic with maximum delivery attempts set to 10.
Question
Key Takeaways
This question tests the selection of exponential backoff for gradual retries versus immediate redelivery, and the necessity of sending dead-lettered messages to a different topic to avoid infinite loops.
To ensure reliable message processing and prevent consumer overload, the correct configuration involves using exponential backoff for retries and dead-lettering to a separate topic after 10 attempts. The community confirms this approach balances retry logic with failure handling.
Common mistake: Choosing Option C is a frequent error because, while it correctly selects exponential backoff, it incorrectly specifies dead-lettering to the same source topic, which causes message loops.
Expert Analysis
Why the Answer Is Correct
Option D is correct because it implements exponential backoff, which gradually increases the wait time between retries, effectively preventing the consumer app from being overloaded during outages. Furthermore, it configures dead-lettering to a different topic, ensuring messages that fail after 10 delivery attempts are stored separately for inspection without disrupting the main pipeline.
Why the Other Options Are Wrong
Option A is incorrect because adjusting the acknowledgement deadline does not inherently handle retry logic or store failed messages. Option B is incorrect because immediate redelivery violates the requirement to retry gradually and avoid overloading the consumer. Option C is incorrect because dead-lettering to the same source topic creates an infinite loop where failed messages are re-processed immediately as new messages.
Community Comment Notes
Community members consistently voted for Option D, emphasizing that exponential backoff is the standard for graceful retries and that dead-lettering must target a distinct topic. Comments highlight that sending failed messages to a different topic allows for isolation of errors, whereas sending them back to the source is a critical architectural flaw.
Official Reference
https://cloud.google.com/pubsub/docs/subscription-overview
This link opens the official vendor documentation in a new tab.
Exam Strategy
When encountering retry requirements in Pub/Sub questions, look for keywords like 'gradually' or 'avoid overloading' to identify exponential backoff. Always remember that dead-letter topics must be separate from the subscription's source topic to prevent infinite processing loops.
Community Votes
100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 6 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 6
-
raaad 👍 15 Answered D- Exponential Backoff: This retry policy gradually increases the delay between retries, which helps to avoid overloading the consumer app. - Dead Lettering to a Different Topic: Configuring dead lettering sends messages that couldn't be processed after the specified number of delivery attempts (10 in this case) to a separate topic. This allows for handling of failed messages without interrupting the regular flow of new messages. - Maximum Delivery Attempts Set to 10: This setting ensures that the system retries each message up to 10 times before considering it a failure and moving it to the dead letter topic.
-
GCP001 👍 3D. Use exponential backoff as the subscription retry policy, and configure dead lettering to a different topic with maximum delivery attempts set to 10 Best suitable options for graceful retry and storing failed messages
-
scaenruy 👍 2 Answered DD. Use exponential backoff as the subscription retry policy, and configure dead lettering to a different topic with maximum delivery attempts set to 10.
-
Pime13 👍 1 Answered Dhttps://cloud.google.com/pubsub/docs/subscription-overview D. Use exponential backoff as the subscription retry policy, and configure dead lettering to a different topic with maximum delivery attempts set to 10. Exponential Backoff: This retry policy helps to avoid overloading the consumer app by gradually increasing the time between retries, which is more efficient than immediate redelivery. Dead Lettering: Configuring dead lettering to a different topic ensures that messages that cannot be processed after the maximum number of retries (10 in this case) are stored separately. This allows you to handle these messages later without losing any data. Reliability: This configuration ensures that your messaging system is reliable and can handle temporary downtime of the consumer app while maintaining data integrity
-
Matt_108 👍 1 Answered DOption D - agree with other comments explanation
Show 1 more comment
-
JyoGCP 👍 1 Answered DOption D
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.