
Answer-first summary for fast verification
Answer: Before deploying new subscriber code, create a Pub/Sub snapshot and employ a Seek operation to resend messages that became available post-snapshot if errors are encountered.
Creating a Pub/Sub snapshot before deploying new subscriber code and using a Seek operation to resend messages available after the snapshot is the recommended approach. This method safeguards against message loss from bugs in new subscriber code by allowing message replay. Cloud Build timestamps (Option A) do not directly address message replay needs. Dead-lettering (Option B) captures unacknowledged messages but doesn't provide a direct method for replaying messages post-deployment. Local testing (Option D) is beneficial but doesn't offer a recovery mechanism for production message loss. References: [Pub/Sub Message Replay](https://cloud.google.com/pubsub/docs/replay-message), [Seek Use Cases](https://cloud.google.com/pubsub/docs/replay-overview#seek_use_cases).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
To prevent message loss due to erroneous acknowledgments after deploying updated subscriber code for a Pub/Sub feed, which strategy should you implement?
A
Utilize Cloud Build for deployment, and refer to a timestamp logged by Cloud Build at the deployment's start if issues arise.
B
Enable dead-lettering on the Pub/Sub topic to catch unacknowledged messages, and resend any messages caught by the dead-letter queue if errors occur.
C
Before deploying new subscriber code, create a Pub/Sub snapshot and employ a Seek operation to resend messages that became available post-snapshot if errors are encountered.
D
Test the new subscriber logic on the Pub/Sub emulator locally before moving it to production.
No comments yet.