What is CreateTopics?
Provisions new topics via kafka-topics.sh --create or AdminClient.createTopics(). The validateOnly flag lets CI pipelines check if a topic config is valid without creating it; NOT_CONTROLLER errors mean the request hit a non-controller broker and will be auto-retried.
Wire Diagram
Response Header · flexible
message_size
int32 · 4B
correlation_id
int32 · 4B
tagged
var
CreateTopicsResponse v7
ThrottleTimeMs
int32 · 4B
tagged
var
Name
string (compact)
TopicId
uuid · 16B
ErrorCode
int16 · 2B
ErrorMessage?
string (compact)
TopicConfigErrorCode
int16 · 2B
NumPartitions
int32 · 4B
ReplicationFactor
int16 · 2B
tagged
var
Name
string (compact)
Value?
string (compact)
ReadOnly
bool · 1B
ConfigSource
int8 · 1B
IsSensitive
bool · 1B
tagged
var
Schema & Example
Schema { "ThrottleTimeMs": int32, "Topics": [{ "Name": string, "TopicId": uuid, "ErrorCode": int16, "ErrorMessage": string?, "TopicConfigErrorCode": int16, "NumPartitions": int32, "ReplicationFactor": int16, "Configs": [{ "Name": string, "Value": string?, "ReadOnly": bool, "ConfigSource": int8, "IsSensitive": bool }]? }] }
Example { "ThrottleTimeMs": 0, "Topics": [{ "Name": "orders", "TopicId": "550e8400-e29b-41d4-a716-446655440000", "ErrorCode": 0, "ErrorMessage": null, "TopicConfigErrorCode": 1, "NumPartitions": 0, "ReplicationFactor": 1, "Configs": [{ "Name": "orders", "Value": "604800000", "ReadOnly": false, "ConfigSource": 4, "IsSensitive": false }]? }] }