1.

How will you change the retention time in Kafka at runtime?

Answer»

A topic's retention time can be configured in Kafka. A topic's DEFAULT retention time is seven days. While creating a new subject, we can set the retention time. When a topic is GENERATED, the broker's property log.retention.hours are used to set the retention time. When configurations for a currently operating topic need to be modified, kafka-topic.sh must be used.

The right COMMAND is determined on the Kafka version in USE.

  • The command to use up to 0.8.2 is kafka-topics.sh --alter.
  • Use kafka-configs.sh --alter STARTING with version 0.9.0.


Discussion

No Comment Found