Configure Google Pub/Sub exactly-once delivery on a pull subscription

domain: gcp-pubsub · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a pull subscription with exactly-once delivery enabled: gcloud pubsub subscriptions create my-sub --topic my-topic --enable-exactly-once-delivery
  2. Note that exactly-once delivery is only supported on pull and StreamingPull subscriptions; push and export subscriptions do not support this feature
  3. The default ack deadline for exactly-once subscriptions is 60 seconds (higher than the standard default); extend it via ModifyAckDeadline if processing takes longer, up to a maximum of 600 seconds
  4. Use the high-level client library's subscriber which manages lease extension automatically; on acknowledgment failure (non-OK status), expect redelivery and ensure your handler is idempotent
  5. With message ordering enabled on the subscription, acknowledge messages in order; out-of-order acks on an ordering-key group will be rejected with a temporary error and the client must retry
  6. Monitor subscription/oldest_unacked_message_age metric in Cloud Monitoring to detect processing backlogs before they cause ack deadline expirations

Known gotchas

Related routes

Enable Google Pub/Sub exactly-once delivery on a subscription
cloud.google.com · 5 steps · unrated
Configure Google Pub/Sub push subscription with ordering keys and dead-letter topic
gcp-pubsub · 6 steps · unrated
Enable Google Cloud Pub/Sub exactly-once delivery and understand minDurationPerAckExtension interaction with client libraries
cloud.google.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans