Configuring Automatic Topic Creation

Automatic Topic Creation indicates that a topic will be automatically created when a message is produced in or consumed from a topic that does not exist. By default, the topic has parameters listed in Table 1.

After you change the value of the log.retention.hours (retention period), default.replication.factor (replica quantity), or num.partitions (partition quantity) parameter, the value will be used in later topics that are automatically created. For example, assume that num.partitions is changed to 5, an automatically created topic has parameters listed in Table 1.

Table 1 Topic parameters

Parameter

Default Value

Modified Value

Partitions

3

5

Replicas

3

3

Aging Time (h)

72

72

Synchronous Replication

Disabled

Disabled

Synchronous Flushing

Disabled

Disabled

Message Timestamp

CreateTime

CreateTime

Max. Message Size (bytes)

10,485,760

10,485,760

Procedure

  1. Log in to the console.

  2. Click image1 in the upper left corner to select a region.

    Note

    Select the region where your Kafka instance is located.

  3. Click Service List and choose Application > Distributed Message Service. The Kafka instance list is displayed.

  4. Click the desired Kafka instance to view its details.

  5. In the Instance Information area, click image2 or image3 next to Automatic Topic Creation. The Confirm dialog box is displayed.

    Note

    Enabling or disabling automatic topic creation may cause instance restarts.

  6. Click OK.

    You can view the execution status of the task on the Background Tasks page.