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.
An enterprise architecture team is designing a real-time streaming ingestion pipeline on Google Cloud using Cloud Pub/Sub to process events across multiple microservices. The Pub/Sub topic enforces an Apache Avro schema that evolves over time as upstream services add optional fields, creating multiple schema revisions.
The downstream subscriber applications maintain their own reader schema and must reliably deserialize incoming binary-encoded messages that may have been published under different schema revisions.
How should the subscriber application be architected to handle messages across evolving schema revisions?
When Cloud Pub/Sub enforces schemas on topics, it attaches system metadata attributes to published messages—such as googclient_schemaname, googclient_schemarevisionid, and googclient_schemaencoding. These attributes identify the exact schema and revision used by the publisher to serialize the message payload.
googclient_schemarevisionid attribute, the subscriber detects the exact writer schema revision used for encoding.Avro DatumReader with both schemas allows Avro to apply schema resolution rules (e.g., handling added optional fields or default values).schema_revision_id to avoid repeated remote API lookups to the Pub/Sub Schema service on every message.This pattern conforms to standard Avro binary schema resolution while utilizing Pub/Sub's native schema revision metadata, enabling decoupled, robust streaming ingestion pipelines.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.