(Optional) Step 3: Create a Topic
A topic is a stream of messages. If automatic topic creation is not enabled during Kafka instance creation, you need to manually create topics for creating and retrieving messages. If automatic topic creation is enabled, this step is optional. The system automatically creates a topic when a message is created. This topic has the following default settings: 3 partitions, 3 replicas, aging time 72 hours, and synchronous replication and flushing disabled.
The following describes how to manually create topics on the console.
Procedure
- Log in to the Kafka console, and select the region where the Kafka instance is located.
- Click a Kafka instance.
- On the Topics page, click Create Topic.
- Enter the topic name, specify other parameters, and click OK.
Table 1 Topic parameters Parameter
Description
Topic Name
Specify the name.
Cannot be changed once the topic is created.
Partitions
Set it to 3.
The more partitions, the higher the consumption concurrency.
Replicas
Set it to 3.
Kafka automatically backs up data on each replica. If one broker is faulty, data will still be available. Reliability increases with the number of replicas of a topic.
NOTE:If an instance node is faulty, an internal service error may be reported when you query messages in a topic with only one replica. Therefore, you are not advised to use a topic with only one replica.
Aging Time (h)
Set it to 72.
How long messages will be preserved in the topic. Messages older than this period cannot be consumed. They will be deleted, and can no longer be retrieved.
Synchronous Replication
Do not enable it.
Synchronous Flushing
Do not enable it.
Follow-Up Procedure
Step 4: Connect to a Kafka Instance to Create and Retrieve Messages
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot