...
1// CreateTopicsRequest creates Kafka topics.
2//
3// Version 4, introduced in Kafka 2.4.0, implies client support for
4// creation defaults. See KIP-464.
5//
6// Version 5, also in 2.4.0, returns topic configs in the response (KIP-525).
7CreateTopicsRequest => key 19, max version 7, flexible v5+, admin
8 // Topics is an array of topics to attempt to create.
9 Topics: [=>]
10 // Topic is a topic to create.
11 Topic: string
12 // NumPartitions is how many partitions to give a topic. This must
13 // be -1 if specifying partitions manually (see ReplicaAssignment)
14 // or, starting v4+, to use the broker default partitions.
15 NumPartitions: int32
16 // ReplicationFactor is how many replicas every partition must have.
17 // This must be -1 if specifying partitions manually (see ReplicaAssignment)
18 // or, starting v4+, to use the broker default replication factor.
19 ReplicationFactor: int16
20 // ReplicaAssignment is an array to manually dicate replicas and their
21 // partitions for a topic. If using this, both ReplicationFactor and
22 // NumPartitions must be -1.
23 ReplicaAssignment: [=>]
24 // Partition is a partition to create.
25 Partition: int32
26 // Replicas are broker IDs the partition must exist on.
27 Replicas: [int32]
28 // Configs is an array of key value config pairs for a topic.
29 // These correspond to Kafka Topic-Level Configs: http://kafka.apache.org/documentation/#topicconfigs.
30 Configs: [=>]
31 // Name is a topic level config key (e.g. segment.bytes).
32 Name: string
33 // Value is a topic level config value (e.g. 1073741824)
34 Value: nullable-string
35 TimeoutMillis(60000)
36 // ValidateOnly is makes this request a dry-run; everything is validated but
37 // no topics are actually created.
38 ValidateOnly: bool // v1+
39
40// CreateTopicsResponse is returned from a CreateTopicsRequest.
41CreateTopicsResponse =>
42 ThrottleMillis(3) // v2+
43 // Topics contains responses to the requested topic creations.
44 Topics: [=>]
45 // Topic is the topic this response corresponds to.
46 Topic: string
47 // The unique topic ID.
48 TopicID: uuid // v7+
49 // ErrorCode is the error code for an individual topic creation.
50 //
51 // NOT_CONTROLLER is returned if the request was not issued to a Kafka
52 // controller.
53 //
54 // TOPIC_AUTHORIZATION_FAILED is returned if the client is not authorized.
55 //
56 // INVALID_REQUEST is returned if the same topic occurred multiple times
57 // in the request.
58 //
59 // POLICY_VIOLATION is returned if the broker is using a
60 // create.topic.policy.class.name that returns a policy violation.
61 //
62 // INVALID_TOPIC_EXCEPTION if the topic collides with another topic when
63 // both topic's names' periods are replaced with underscores (e.g.
64 // topic.foo and topic_foo collide).
65 //
66 // TOPIC_ALREADY_EXISTS is returned if the topic already exists.
67 //
68 // INVALID_PARTITIONS is returned if the requested number of partitions is
69 // <= 0.
70 //
71 // INVALID_REPLICATION_FACTOR is returned if the requested replication
72 // factor is <= 0.
73 //
74 // INVALID_REPLICA_ASSIGNMENT is returned if not all partitions have the same
75 // number of replicas, or duplica replicas are assigned, or the partitions
76 // are not consecutive starting from 0.
77 //
78 // INVALID_CONFIG is returned if the requested topic config is invalid.
79 // to create a topic.
80 ErrorCode: int16
81 // ErrorMessage is an informative message if the topic creation failed.
82 ErrorMessage: nullable-string // v1+
83 // ConfigErrorCode is non-zero if configs are unable to be returned.
84 //
85 // This is the first tagged field, introduced in version 5. As such, it is
86 // only possible to be present in v5+.
87 ConfigErrorCode: int16 // tag 0
88 // NumPartitions is how many partitions were created for this topic.
89 NumPartitions: int32(-1) // v5+
90 // ReplicationFactor is how many replicas every partition has for this topic.
91 ReplicationFactor: int16(-1) // v5+
92 // Configs contains this topic's configuration.
93 Configs: nullable[=>] // v5+
94 // Name is the configuration name (e.g. segment.bytes).
95 Name: string
96 // Value is the value for this config key. If the key is sensitive,
97 // the value will be null.
98 Value: nullable-string
99 // ReadOnly signifies whether this is not a dynamic config option.
100 ReadOnly: bool
101 // Source is where this config entry is from. See the documentation
102 // on DescribeConfigsRequest's Source for more details.
103 Source: int8(-1)
104 // IsSensitive signifies whether this is a sensitive config key, which
105 // is either a password or an unknown type.
106 IsSensitive: bool
View as plain text