Creates a topic.
- Each user can send a maximum of one query per second (QPS).
- The maximum number of topics that can be created in an instance depends on the instance type that you have purchased.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateTopic |
The operation that you want to perform. Set the value to CreateTopic. |
InstanceId | String | Yes | alikafka_pre-cn-mp919o4v**** |
The ID of the Message Queue for Apache Kafka instance on which you want to create the topic. |
RegionId | String | Yes | cn-hangzhou |
The ID of the region where the instance is located. |
Remark | String | Yes | alikafka_topic_test |
The description of the topic.
|
Topic | String | Yes | alikafka_topic_test |
The name of the topic.
|
PartitionNum | String | No | 12 |
The number of partitions in the topic.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | Integer | 200 |
The response code. The HTTP 200 code indicates that the request was successful. |
Message | String | operation success |
The response message. |
RequestId | String | 9C0F207C-77A6-43E5-991C-9D98510A**** |
The ID of the request. |
Success | Boolean | true |
Indicates whether the request was successful. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=CreateTopic
&InstanceId=alikafka_pre-cn-mp919o4v****
&RegionId=cn-hangzhou
&Remark=alikafka_topic_test
&Topic=alikafka_topic_test
&<Common request parameters>
Sample success responses
XML
format
<CreateTopicResponse>
<RequestId>9C0F207C-77A6-43E5-991C-9D98510A****</RequestId>
<Message>operation success</Message>
<Code>200</Code>
<Success>true</Success>
</CreateTopicResponse>
JSON
format
{
"RequestId": "9C0F207C-77A6-43E5-991C-9D98510A****",
"Message": "operation success",
"Code": 200,
"Success": true
}
Error codes
For a list of error codes, visit the API Error Center.