CCDAK practice question 8 of 25
How will you set the retention for the topic named “my-topic” to 1 hour?
Full set: 150 questionsThe retention.ms configuration parameter controls the time-based retention policy for data in a Kafka topic. To configure a specific topic, this parameter must be set at the topic level. This overrides the broker-wide default, which is configured by log.retention.ms. Setting the topic configuration retention.ms to 3600000 directly applies a retention period of 1 hour (60 minutes 60 seconds 1000 ms) specifically to "my-topic". This can be done either when creating the topic or by altering an existing topic's configuration.
A. Setting the broker config log.retention.ms applies a default retention policy to all topics on that broker, not specifically to "my-topic".
B. retention.ms is not a valid consumer configuration. Consumers read data but do not manage its retention policy on the broker.
D. retention.ms is not a valid producer configuration. Producers send data but do not control how long it is stored on the broker.
1. Confluent Documentation, "Topic-Level Configs": This document lists retention.ms as a per-topic configuration. It states, "This configuration controls the maximum time we retain a log before we discard it to free up space."
Source: Confluent Documentation, Server Configuration Properties, Topic-Level Configs section, retention.ms entry.
2. Apache Kafka Documentation, "Topic-Level Configs": The official Kafka documentation explicitly defines retention.ms as a configuration that can be set for individual topics to control message retention time.
Source: Apache Kafka Documentation, 3.7, Configuration, Topic-Level Configs section.
3. Apache Kafka Documentation, "Broker Configs": This reference distinguishes the broker-level default log.retention.ms from the topic-specific retention.ms. It clarifies that the broker setting is a default, which can be overridden per topic.
Source: Apache Kafka Documentation, 3.7, Configuration, Broker Configs section, log.retention.ms entry.
Keep practicing
Take the free CCDAK practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CCDAK practice questions
- Question 1In Avro, removing or adding a field that has a default is a __ schema evolution
- Question 2A topic has three replicas and you set min.insync.replicas to 2. If two out of three repl…
- Question 3To get acknowledgement of writes to only the leader partition, we need to use the config.…
- Question 4A customer has many consumer applications that process messages from a Kafka topic. Each …
- Question 5What information isn't stored inside of Zookeeper? (select two)
- Question 6If you enable an SSL endpoint in Kafka, what feature of Kafka will be lost?
