Configure Apache Pulsar Key_Shared subscription for ordered per-key fan-out

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

Steps

  1. Create a consumer with subscription type Key_Shared; all messages sharing the same orderingKey (or message key) are routed to the same consumer, while different keys can be processed in parallel by different consumers
  2. Choose between AUTO_SPLIT (consistent hashing, keys redistributed on consumer join/leave) and STICKY (manual key range assignment per consumer) hash range modes
  3. For STICKY mode, set KeySharedPolicy.stickyHashRange(startRange, endRange) on the consumer to pin a specific hash range; the broker only delivers messages whose key hash falls in that range to this consumer
  4. Handle subscription changes: when a consumer joins or leaves under AUTO_SPLIT, a short rebalancing period may cause a brief pause in delivery for keys that are being reassigned
  5. Set consumer receiveQueueSize appropriately; a size of 0 disables pre-fetching and ensures the consumer only receives one message at a time, useful for strict ordering requirements at the cost of throughput
  6. Monitor consumerStats via the Pulsar Admin API to observe per-consumer message rates and detect hot keys where one consumer receives disproportionately more traffic

Known gotchas

Related routes

Configure Apache Pulsar Key_Shared subscription with sticky hash range assignment for ordered per-key fan-out
pulsar.apache.org · 6 steps · unrated
avoid ordering and skew pitfalls when using pulsar's key_shared subscription
pulsar.apache.org · 5 steps · unrated
Configure Apache Pulsar namespace-level message encryption with end-to-end encryption
pulsar.apache.org · 5 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