Bird
0
0

Which configuration should you apply?

hard📝 Best Practice Q15 of 15
GCP - Cloud Pub/Sub
You want to ensure that messages in your Pub/Sub subscription are retained for 3 days even if they are not acknowledged, but also want to avoid message duplication after acknowledgment. Which configuration should you apply?
ASet message retention duration to 0 and rely on subscriber retries.
BSet message retention duration to 3 days and disable acknowledgments.
CSet message retention duration to 7 days and never acknowledge messages.
DSet message retention duration to 3 days and ensure subscriber acknowledges messages promptly.
Step-by-Step Solution
Solution:
  1. Step 1: Understand retention and acknowledgment roles

    Retention keeps unacknowledged messages for specified time. Acknowledgment removes messages to avoid duplicates.
  2. Step 2: Choose configuration to meet goals

    Setting retention to 3 days keeps messages if unacknowledged. Prompt acknowledgment removes processed messages, preventing duplicates.
  3. Final Answer:

    Set message retention duration to 3 days and ensure subscriber acknowledges messages promptly. -> Option D
  4. Quick Check:

    Retention + prompt ack = no duplicates, messages kept [OK]
Quick Trick: Retention keeps unacked; ack removes to prevent duplicates [OK]
Common Mistakes:
  • Disabling acknowledgments causing duplicates
  • Setting retention to 0 losing unacked messages quickly
  • Never acknowledging causing message buildup and duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes