A Python automation uses Cloud Pub/Sub to trigger work. You need to ensure that processing is effectively-once despite possible duplicate deliveries. Which approach is most appropriate?
Answer
Implement idempotent processing keyed by message ID or a dedup token persisted in durable storage
Explanation
Pub/Sub provides at-least-once delivery, so idempotent handlers with durable deduplication prevent double side effects.
Last reviewed: October 2026
Reviewed by FirstInTest Editorial Team
Related questions
A workflow uploads many files to Cloud Storage and then triggers a processing job. How can you guarantee that the processing job sees a consistent set of uploaded objects?
View question →
A Python script polls a Cloud operation until completion. Which approach best handles eventual consistency and avoids infinite waiting or premature termination?
View question →
Which technique is most suitable for managing secrets used by Python automation (API keys, tokens) in Google Cloud environments?
View question →
In a Python automation workflow using Google Cloud APIs, which strategy most effectively prevents partial failures from leaving orphaned resources when a sequence of calls fails mid-run?
View question →
Text describes an automation that polls for a long-running job result. The script stores the job name and last seen state locally, then restarts after a crash. What capability does the script most rely on to avoid missing completion when restarted?
View question →
You need to automate the provisioning of a Compute Engine instance from Python using service account credentials. Which practice is most appropriate for least-privilege and credential security in production?
View question →