Google Cloud Professional Cloud Developer Study Guide: Cloud Run, Pub/Sub, and Idempotency
Prepare for Google Cloud Professional Cloud Developer with a practical Cloud Run and Pub/Sub exercise covering retries, duplicate deliveries, and application observability.
For Google Cloud Professional Cloud Developer, practice building a Cloud Run push subscriber that tolerates duplicate delivery. Give each business event a durable key, record the outcome before acknowledging successful processing, and test the case where the business write succeeds but the acknowledgment does not reach Pub/Sub.
Use the exam guide to organize the lab
Open Google’s Professional Cloud Developer certification page and follow the exam guide for your appointment. Map this practice case to application design, service integration, deployment, and operations. Keep separate study sessions for the broader objectives, such as testing and deployment strategy across a development lifecycle. The goal of this lab is to reason about one complete event-driven path.
Sketch a publisher, a Pub/Sub topic, a push subscription, a Cloud Run service, and a durable store. Label the identity making the push request and the runtime identity used by the application. In a sandbox, assign only the access required for each role. Verify that the authorized subscription can invoke the service and check that an unauthenticated request is rejected by the intended access configuration.
Follow the same event through two delivery attempts
A publisher emits an OrderAccepted event with business event ID OA-104. The subscriber writes the corresponding order to a datastore. In the first delivery, the write commits, but the service response is lost or arrives too late to be accepted as an acknowledgment. Pub/Sub can deliver again. Without a duplicate-handling design, the second attempt may repeat the business effect.
Record OA-104 as a durable idempotency key. A stable publisher-assigned business identifier can also handle cases where the same event is republished as a new Pub/Sub message. Keep the Pub/Sub message ID for diagnostics. Document how the publisher chooses a new business identifier when a later event legitimately affects the same order, because the order identifier alone might collapse separate valid operations.
Keep duplicate detection consistent with the write
Choose a datastore operation that can atomically establish the unique event key and apply the business change. If two invocations process the same event concurrently, only one should create the durable effect. A committed duplicate can be acknowledged successfully. If the transaction fails temporarily, let the configured delivery mechanism retry. Test concurrency directly using the same synthetic identifier.
An in-memory set can help illustrate the idea in a unit test, but scaled Cloud Run instances and restarts require durable coordination for the real guarantee. If the business operation spans systems that cannot share a transaction, consider a durable outbox or an idempotency key recognized by the downstream service. Record which side effect the original transaction guarantees and how downstream completion can be verified.
Choose responses from the outcome of processing
In a push subscription, returning a supported success response such as HTTP 204 acknowledges delivery. A non-success response or acknowledgment deadline expiration can lead to redelivery. Do not assume the pull-only exactly-once feature applies to a push subscription. In the lab, have the subscriber respond successfully only after the required state has been recorded or the event is known to be an already committed duplicate.
Decide how the system handles invalid messages and temporary dependency failures. A temporary write failure should follow the agreed retry policy. An invalid event requires a clear terminal handling path, such as sending it to an approved quarantine process or configuring a dead-letter topic for repeated failures. Test that failures are visible to an operator and that valuable messages are not silently discarded.
Measure business outcomes as well as delivery health
Publish OA-104 twice and show that the business effect appears once. Then simulate a temporary write failure and inspect how a later delivery completes the same event. Finally, simulate a response lost after commit and confirm that the duplicate path returns success. Log the business event ID, message ID, and processing outcome without printing sensitive payloads.
Use the same lab to practice an exam explanation. A system can have repeated delivery attempts with one durable result. It can also have healthy infrastructure and a backlog caused by slow application processing. Connect the observation to the relevant logs or metrics, then name the smallest change or test that would distinguish authentication failures, temporary datastore failures, and duplicate handling.
Your next steps
- Preserve an identifier that represents the business event.
- Acknowledge successful processing after the durable transaction commits.
- Test duplicate deliveries, temporary dependency failures, and unauthorized invocation.
Sources & official resources
Linked resources checked on 2026-11-26. Technical behavior and provider guidance can change; check the documentation for the version you use.
About this guide and its recommendations
Published by Prep With Proof with AI-assisted drafting. Study routines and examples are editorial suggestions, not official exam instructions or claims of a learner's personal results. Cited provider facts are linked; ownership of recommended Prep With Proof products is disclosed. No competitor endorsement or guaranteed certification outcome is implied.
Suggest a correction →