professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
A data engineering team operates a 24/7 streaming Cloud Dataflow pipeline written in Java that ingests high-volume JSON event streams from Pub/Sub and writes structured rows into BigQuery. Recently, unexpected schema changes upstream have caused malformed JSON payloads, leading to uncaught runtime parsing exceptions inside a DoFn that cause streaming worker tasks to retry indefinitely and stall the pipeline.
The team needs to update the Apache Beam pipeline architecture to validate incoming records, immediately divert uncorrectable corrupt payloads to a dead-letter storage sink for auditing and reprocessing, and ensure that valid data continues to flow to BigQuery without pipeline disruption.
Which design pattern should the team implement?
In Apache Beam, a multi-output transform allows a single ParDo (or DoFn) to produce multiple distinct PCollection streams differentiated by TupleTag identifiers. This is the standard architectural pattern for building dead-letter queues (DLQs) and robust error-handling pipelines in both batch and streaming execution on Cloud Dataflow.
try-catch blocks within the DoFn.ProcessElement method, unparseable elements do not raise unhandled runtime exceptions. This prevents the Dataflow streaming runner from entering infinite retry loops.MultiOutputReceiver.get(deadLetterTag).output(errorObj).Row structures and emitted to the primary output TupleTag, allowing downstream BigQuery insertion transforms to proceed uninterrupted.Unlike throwing exceptions or dropping corrupt data silently, using Beam side outputs (TupleTag) allows branching the execution graph cleanly into distinct downstream pipelines—one for production analytical storage and another for dead-letter archival in Cloud Storage, Pub/Sub, or BigQuery.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.