tencent cloud

Feedback

Creating Topic

Last updated: 2022-10-13 15:04:41

    Overview

    Topic is a category name where messages are stored and published. With CKafka, producers write messages to topics, and consumers read messages from topics. To enable horizontal scaling, a topic is divided into multiple partitions. This allows you to horizontally scale your resources by adding more partitions in case of performance bottlenecks.

    This document describes how to create a topic in the CKafka console.

    Prerequisites

    You have created an instance as instructed in Creating Instance.

    Directions

    Step 1. Create a topic

    1. Log in to the CKafka console.
    2. On the Instance List page, click the ID/Name of the target 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.
      • Replica Count: The number of partition replicas, which ensure the high availability of partitions. For data reliability considerations, 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).
        Note:

        Creating a single-replica topic cannot guarantee the availability; therefore, you should choose it 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:

    Parameter Default Value Valid Values Description
    cleanup.policy delete delete/compact Log can be deleted by retention time, or can be compacted by key (the compact mode is required for kafka connect).
    min.insync.replicas 1 - When "producer" sets "request.required.acks" to 1, "min.insync.replicas" will specify the minimum number of replicas.
    unclean.leader.election.enable true true/false This parameter specifies whether a replica not in ISR can be set as a leader.
    segment.ms - 5 mins–90 days The segment shard rolling duration in ms. Minimum value: 86,400,000 ms.
    retention.ms The message retention period of the instance 60000 ms–90 days The message retention period at the topic level.
    retention.bytes The message retention size of the instance 1–1024 GB The message retention size at the topic level. 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.
    max.message.bytes - 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