Updated on 2023-05-06 GMT+08:00

Modifying Topic Aging Time

Aging time is a period that messages in the topic are retained for. Consumers must retrieve messages before this period ends. Otherwise, the messages will be deleted and can no longer be retrieved.

After creating a topic, you can change its aging time based on service requirements. Changing the aging time does not affect services. The default aging time is 72 hours.

You can change the aging time in either of the following ways:

  • By editing the topic on the Topics tab page
  • By changing the value of the log.retention.hours parameter on the Parameters tab page. For details, see Modifying Kafka Parameters.

The log.retention.hours parameter takes effect only for topics that have no aging time configured. If there is aging time configured for a topic, it overrides the log.retention.hours parameter. For example, if the aging time of Topic01 is set to 60 hours and log.retention.hours is set to 72 hours, the actual aging time of Topic01 is 60 hours.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner to select a region.

    Select the region where your Kafka instance is located.

  3. Click and choose Application > Distributed Message Service for Kafka to open the console of DMS for Kafka.
  4. Click the desired Kafka instance to view the instance details.
  5. Click the Topics tab.
  6. Modify the topic aging time using either of the following methods:

    • Select one or more topics and click Edit Topic in the upper left corner.
    • In the row containing the desired topic, click Edit.

  7. In the Edit Topic dialog box, enter the aging time and click OK.