Google Cloud Professional Data Engineer — Question 284

You are updating the code for a subscriber to a Pub/Sub feed. You are concerned that upon deployment the subscriber may erroneously acknowledge messages, leading to message loss. Your subscriber is not set up to retain acknowledged messages. What should you do to ensure that you can recover from errors after deployment?

Answer options

Correct answer: B

Explanation

The correct answer is B because creating a Pub/Sub snapshot allows you to preserve the state of messages before deploying the new code. This way, if there are issues after deployment, you can use the Seek operation to re-deliver messages that were available at the time of the snapshot. The other options do not provide a direct method for recovering messages that may be lost due to erroneous acknowledgments during deployment.