What is CreatePartitions?
Increases a topic's partition count via kafka-topics.sh --alter --partitions. Partition count can only go up, never down. Adding partitions breaks message ordering for keys previously co-located on the same partition (key-based producers must rehash), so coordinate carefully.
Wire Diagram
Request Header · flexible
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id
string (compact)
tagged
var
CreatePartitionsRequest v3
TimeoutMs
int32 · 4B
ValidateOnly
bool · 1B
tagged
var
Name
string (compact)
Count
int32 · 4B
tagged
var
BrokerIds
[]int32
tagged
var
Schema & Example
Schema { "Topics": [{ "Name": string, "Count": int32, "Assignments": [{ "BrokerIds": [int32] }]? }], "TimeoutMs": int32, "ValidateOnly": bool }
Example { "Topics": [{ "Name": "orders", "Count": 10, "Assignments": [{ "BrokerIds": [1, 2, 3] }]? }], "TimeoutMs": 30000, "ValidateOnly": true }