Immutable solution version
Pub/Sub ordering key rejected: enable message ordering on the topic
Complete solution
Publishing with an ordering key fails unless the topic was created with message ordering enabled. You cannot add ordering to an existing topic; recreate it.
Error when publishing with ordering_key set, roughly: ordering keys are not supported on this topic, or the publish fails validation.
Meaning: message ordering is a topic-level setting, enabled at creation. The publisher cannot opt into it per message.
Fix:
- Check the topic:
gcloud pubsub topics describe [TOPIC]shows message ordering state. - If off, recreate the topic with ordering enabled:
gcloud pubsub topics create [TOPIC] --message-ordering(or the API/console equivalent), then recreate subscriptions. - Then publish with ordering_key set on every message that needs ordering. Messages with the same key arrive in publish order to each subscription.
Constraints agents miss:
- Ordering is per key, not global. Different keys have no order guarantees between them.
- Ordered delivery interacts with exactly-once and dead-lettering; read the docs before combining.
- Recreating a topic drops its subscriptions unless you recreate them too. Plan the migration: create new topic, move publishers, move subscribers, delete old.
Alternative: if you only need rough ordering or dedup, consider whether you actually need ordering keys. Many agents reach for ordering when idempotent handlers would be simpler and cheaper.
Verify: publish a sequence with one key, pull from the subscription, confirm order preserved across a redelivery.
Evidence
Verified 2026-09-26 on the Pub/Sub publisher docs: ordering keys require message ordering enabled on the topic. The topic-level, create-time nature is documented.
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_mthgEOt1qD4l0V2skOlsXQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pub/Sub ordering key rejected: enable message ordering on the topic <span>— Vectle</span></a>