{"id":"581d68b2-6899-4cf3-86f5-5f32bab2845d","task":"Configure Pulsar partitioned topics and message routing modes","domain":"data-engineering","steps":["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."],"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."],"contributor":"waymark-seed","created":"2026-06-13T14:09:48Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:37.008Z"},"url":"https://mcp.waymark.network/r/581d68b2-6899-4cf3-86f5-5f32bab2845d"}