How Can New Pub/Sub Subscribers Read the Last 30 Days of Clickstream Data?
You work for a large ecommerce company. You are using Pub/Sub to ingest the clickstream data to Google Cloud for analytics. You observe that when a new subscriber connects to an existing topic to analyze data, they are unable to subscribe to older data. For an upcoming yearly sale event in two months, you need a solution that, once implemented, will enable any new subscriber to read the last 30 days of data. What should you do?
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The exam tests the difference between topic retention (up to 31 days, benefits all future subscribers) and subscription retention (max 7 days, only affects one existing subscription) — the trap is confusing the two retention settings.
Setting a 30-day message retention policy on the Pub/Sub topic allows any new subscriber created later to seek back and consume the last 30 days of published clickstream data. The community unanimously (100%) supports answer B, since topic-level retention applies to messages regardless of when a subscription is created.
Choosing C (subscriber retention policy) because 'retention' appears in both settings; subscription retention is capped at 7 days and only applies to that single pre-existing subscription, so it cannot give new subscribers 30 days of history.
Community Discussion (8 comments)
- Topic Retention Policy: This policy determines how long messages are retained by Pub/Sub after they are published, even if they have not been acknowledged (consumed) by any subscriber. - 30 Days Retention: By setting the retention policy of the topic to 30 days, all messages published to this topic will be available for consumption for 30 days. This means any new subscriber connecting to the topic can access and analyze data from the past 30 days.
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
A Pub/Sub topic message retention policy retains published messages for a configurable period (up to 31 days) even if no subscription has consumed or acknowledged them. When a new subscriber is later created, it can seek/replay to read any messages retained on the topic within that window, so a 30-day policy exactly meets the requirement for the yearly sale event. The most-liked comment [1] explains that topic retention keeps messages available for consumption for 30 days regardless of when a subscriber connects. Comment [2] links Google's official blog announcing the topic retention feature, confirming this is the designed use case. It is a pure configuration change, implementable well before the event in two months, with no data movement required.Why the Other Options Are Wrong
Options A and D require manually republishing or re-pushing 30 days of data every time a new subscriber connects — an operationally fragile, non-scalable anti-pattern that Google exams consistently reject in favor of managed configuration. Option C fails for two reasons: per comment [6] (linking the official subscription-properties documentation), subscription retention has a maximum of 7 days, which cannot cover 30 days; moreover, a subscription retention policy only affects that specific existing subscription, not subscribers created in the future. Comments [4] and [5] argue for A, claiming topic retention only keeps unconsumed messages, but that is precisely the intended behavior — retained messages become readable by new subscribers via seek — and they are outliers against a 100% community vote.Community Comment Notes
The vote distribution is unanimous (B: 100%), signaling strong consensus. Comment [1] (11 likes) gives the clearest explanation of how topic retention works for new subscribers. Comment [6] contributes the decisive technical detail — the 7-day maximum for subscription retention — which eliminates option C definitively. Comment [2] supplies the official Google blog URL as evidence, while the dissenting comments [4] and [5] misread the retention semantics and should be treated as noise.Official Reference
Exam Strategy
Whenever a Pub/Sub question involves new subscribers needing access to historical messages, immediately compare topic retention (up to 31 days, covers all future subscribers) against subscription retention (max 7 days, single subscription only). Strongly prefer managed, configuration-only answers over options that require republishing or re-pushing data, as those are almost always distractors on the Professional Data Engineer exam.