Create a partitioned topic with a specified number of partitions: pulsar-admin topics create-partitioned-topic persistent://tenant/namespace/topic --partitions 8.
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).
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.
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.
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
Partition count cannot be reduced after creation; plan capacity carefully, as too few partitions limits parallelism and too many increases metadata overhead.
RoundRobinPartition batches messages by partition in the producer's send buffer; if the batch window is short, effective distribution may not be perfectly round-robin.
Consumers using Exclusive subscription on a partitioned topic can only have one consumer per partition-level sub-topic; use Shared or Key_Shared for fan-out across more consumers than partitions.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp