Configure Pulsar partitioned topics and message routing modes

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

Steps

  1. Create a partitioned topic with a specified number of partitions: pulsar-admin topics create-partitioned-topic persistent://tenant/namespace/topic --partitions 8.
  2. Producers writing to a partitioned topic use a message routing mode: RoundRobinPartition (default, distributes evenly), SinglePartition (all messages to one random partition unless a key is set), CustomPartition (user-supplied MessageRouter implementation).
  3. When a message key is set (producer.newMessage().key('myKey').value(data)), the default routing uses a hash of the key to select a partition, ensuring all messages with the same key land on the same partition.
  4. Consumers subscribe to the partitioned topic by name; Pulsar internally creates sub-topics (topic-partition-0, topic-partition-1, etc.) and distributes partitions across consumers.
  5. Increase or decrease partition count: pulsar-admin topics update-partitioned-topic --partitions 16. Note that decreasing partitions is not supported; only increasing is allowed.

Known gotchas

Related routes

Configure Apache Pulsar topics, subscriptions, and subscription types
pulsar.apache.org · 5 steps · unrated
Configure Pulsar topic compaction, retention, and TTL
data-engineering · 5 steps · unrated
Configure Apache Pulsar topic-level policies for retention, TTL, and backlog quota
pulsar.apache.org · 5 steps · unrated

Give your agent this knowledge — and 15,600+ 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