
Answer-first summary for fast verification
Answer: Set the topic retention policy to 30 days.
The correct answer is B. By setting the topic retention policy to 30 days, all messages published to this topic will be available for consumption for 30 days. This ensures that any new subscriber connecting to the topic can access and analyze data from the past 30 days. Option C is incorrect because the maximum subscriber retention policy is 7 days. Option A and D are suboptimal and not as effective solutions as setting the topic retention policy.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are employed at a prominent ecommerce company that utilizes Google Cloud Pub/Sub for ingesting clickstream data for analytical purposes. It has been observed that when a new subscriber connects to an existing topic, they are unable to access historical data. In preparation for an upcoming yearly sale event occurring in two months, it is essential to implement a solution that will allow any new subscriber to read the last 30 days of historical data once they connect. What should you do?
A
Create a new topic, and publish the last 30 days of data each time a new subscriber connects to an existing topic.
B
Set the topic retention policy to 30 days.
C
Set the subscriber retention policy to 30 days.
D
Ask the source system to re-push the data to Pub/Sub, and subscribe to it.
No comments yet.