Your company ingests real-time purchase events through a Cloud Pub/Sub → Dataflow → BigQuery pipeline. The Dataflow job currently acknowledges each message as soon as it is read and only logs JSON parsing errors. Recently, an upstream bug produced malformed JSON for several hours; the pipeline acknowledged these messages, so they were neither processed nor recoverable. You must redesign ingestion so malformed events are retained for later inspection and replay without increasing latency for valid events. Which approach best meets these needs?
Write incoming events to a staging table with BigQuery MERGE and schedule daily table snapshots to Cloud Storage so you can roll back if corruption occurs.
Enable Pub/Sub exactly-once delivery and rely on BigQuery time-travel to restore any rows that might be missing from the production table.
Insert a Cloud Function publisher proxy that validates JSON and drops any message that fails validation before it reaches Pub/Sub.
Configure the subscription with a dead-letter topic and modify the Dataflow pipeline to acknowledge only successfully parsed messages; unacknowledged messages are eventually routed to the dead-letter topic for later reprocessing.
Using a Pub/Sub dead-letter topic lets the subscription automatically divert messages that exceed a maximum redelivery count. By changing the Dataflow pipeline to acknowledge a message only after it is successfully parsed and written to BigQuery, valid events keep their normal low-latency path. Malformed events are nacked, retried up to the configured maximum, and then routed to the dead-letter topic for later examination or replay, preventing silent data loss. Exactly-once delivery does not protect against messages that the application acknowledges before processing, BigQuery snapshots or MERGE operations address issues after data is stored, and dropping malformed events before publishing eliminates the ability to replay them.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a dead-letter topic in Pub/Sub?
Open an interactive chat with Bash
How does Dataflow acknowledge messages in Pub/Sub?
Open an interactive chat with Bash
Why is Pub/Sub exactly-once delivery not suitable for this scenario?
Open an interactive chat with Bash
What is a dead-letter topic in Pub/Sub?
Open an interactive chat with Bash
How does Dataflow handle unacknowledged messages?
Open an interactive chat with Bash
What is Pub/Sub exactly-once delivery, and why wouldn’t it address this issue?
Open an interactive chat with Bash
GCP Professional Data Engineer
Maintaining and automating data workloads
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .