topic modify

Prev Next

This command modifies a topic.

Usage

topic modify --database-name NAME
             --name NAME
             [--new-name NEW_NAME]
             [--retention-ms MILLISECONDS]
             [--message-timestamp-type CreateTime|LogAppendTime] 
             [--message-timestamp-before-max-ms MILLISECONDS]
             [--message-timestamp-after-max-ms MILLISECONDS]

Required Parameters

--database-name NAME

The name of the database where the topic resides.

--name NAME

The name of the topic to be modified.

Options

--new-name  NEW_NAME

This option lets you rename an existing topic.

--retention-ms MILLISECONDS

The amount of time, in milliseconds, to keep an event record in the topic. When the retention period for a record expires, the records is deleted from the topic.

The default retention period is seven days. The minimum allowed retention period is 6 hours. A value of -1 means no retention period.

--message-timestamp-type CreateTime|LogAppendTime

Determines how the event timestamp is set:

  • CreateTime (default): The timestamp is based on the time when the event was encountered at the event producer.

  • LogAppendTime: The timestamp is based on the time when the event record was added to the log at the event broker.

--message-timestamp-before-max-ms MILLISECONDS

If the message timestamp type is set to CreateTime, specify this option to determine how much earlier the message timestamp can be than the broker timestamp. If this value is exceeded, the message is rejected.

--message-timestamp-after-max-ms MILLISECONDS

If the message timestamp type is set to CreateTime, specify this option to determine how much later the message timestamp can be than the broker timestamp. If this value is exceeded, the message is rejected.

Example

To set the message timestamp type to LogAppendTime:

vcli: admin> topic modify --database-name kafkatopics --name mytopic --message-timestamp-type LogAppendTime