tencent cloud


Creating Topic

Last updated: 2024-01-09 14:47:31


    Topic is the name of a category where messages can be stored and published. CKafka uses the concept of topic externally, that is, a producer writes messages to a topic, while a consumer read messages from it. To implement horizontal scaling, a topic actually consists of multiple partitions. When a performance bottleneck occurs, you can scale out the topic by adding more partitions.
    This document describes how to create a topic in the CKafka console.


    You have created an instance as instructed in Creating Instance.


    Step 1. Create a topic

    1. Log in to the CKafka console.
    2. In the instance list, click the ID/Name of your instance to enter the instance details page.
    3. On the instance details page, click Topic Management at the top and click Create.
    4. In the Create Topic window, set the Partition Count, Replica Count, and other parameters.
    Name: The topic name. It cannot be changed once entered and can contain only letters, digits, underscores, or symbols ("-" and ".").
    Partition Count: It is a concept in physical partition, where one topic can contain one or more partitions. CKafka uses partition as an allocation unit. For more information on how to configure the partition count, see Configuration Guide for Common Parameters in CKafka.
    Replica Count: The number of partition replicas that are used to ensure the high availability of the partition. To ensure data availability, two replicas are enabled by default. Replicas are also counted into the number of partitions. For example, if you create 1 topic with 6 partitions and 2 replicas for each partition, then you have a total of 12 partitions (1 x 6 x 2).
    A single-replica topic cannot guarantee high availability. Select the partition count with caution.
    Tag: Set a resource tag. For more information, see Tag Overview.
    Preset ACL Policy: Select the preset ACL policy. For more information on ACL policy, see Configuring ACL Policy.
    5. Click Submit.

    Step 2. Configure advanced topic parameters

    1. On the instance list page, click the ID/Name of the target instance to enter the instance details page.
    2. On the instance details page, select Topic Management.
    3. In the Operation column, click Edit > Show advanced configuration and set the following parameters:
    The parameters are as detailed below:
    Default Value
    Valid Values/Value Range
    Log can be deleted by retention time, or can be compacted by key (the compact mode is required for kafka connect).
    When "producer" sets "request.required.acks" to 1, "min.insync.replicas" will specify the minimum number of replicas.
    This parameter specifies whether a replica not in ISR can be set as a leader.
    5 minutes–90 days
    The segment shard rolling duration in ms. Minimum value: 86,400,000 ms.
    The message retention period of the instance.
    60,000 ms–90 days
    The message retention period at the topic level.
    The message retention size of the instance.
    1–1,024 GB
    Message retention size for a topic = partition count * retention.bytes. If both the message retention period and message retention size are set for a topic, the actual message retention will be determined by which threshold is reached first.
    1 KB–12 MB
    The maximum message size at the topic level. If this parameter is left empty, it will be 1 MB by default.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support