How Can New Pub/Sub Subscribers Read the Last 30 Days of Clickstream Data?
Short answer
B Set the topic retention policy to 30 days.
Question
Key Takeaways
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.
Common mistake: 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.
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
- https://cloud.google.com/blog/products/data-analytics/pubsub-gains-topic-retention-feature
- https://cloud.google.com/pubsub/docs/subscription-properties
- https://cloud.google.com/pubsub/docs/replay-overview
These links open the official vendor documentation in a new tab.
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.
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 8 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 8
-
raaad 👍 11 Answered B- 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.
-
Sofiia98 👍 4 Answered Bhttps://cloud.google.com/blog/products/data-analytics/pubsub-gains-topic-retention-feature
-
romain773 👍 1Option B is wrong i think (topic retention) because it only makes unconsumed messages available for 30 days. I propose option A Option A (creating a new topic and republishing the last 30 days of data for each new subscriber) is actually a better solution to ensure that new subscribers have access to the full 30-day history.
-
romain773 👍 1Option B is wrong (topic retention) because it only makes unconsumed messages available for 30 days. Option A (creating a new topic and republishing the last 30 days of data for each new subscriber) is actually a better solution to ensure that new subscribers have access to the full 30-day history.
-
hussain.sain 👍 1 Answered BB is correct. By setting the topic retention policy to 30 days, any new subscriber will be able to access the data for the past 30 days, regardless of when they connect. This solution is both cost-effective and efficient for your use case.
Show 3 more comments
-
joao_01 👍 1Its B. It could be C as well because subscription has message retention. However, in the subscription there is a maximum value for it: 7 days. Link:https://cloud.google.com/pubsub/docs/subscription-properties
-
scaenruy 👍 1 Answered BB. Set the topic retention policy to 30 days.
-
Matt_108 👍 2 Answered BDefinitely B
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.