use of org.zalando.nakadi.exceptions.runtime.TopicConfigException in project nakadi by zalando.
the class KafkaTopicRepository method setRetentionTime.
@Override
public void setRetentionTime(final String topic, final Long retentionMs) throws TopicConfigException {
try {
doWithZkUtils(zkUtils -> {
final Properties topicProps = AdminUtils.fetchEntityConfig(zkUtils, ConfigType.Topic(), topic);
topicProps.setProperty("retention.ms", Long.toString(retentionMs));
AdminUtils.changeTopicConfig(zkUtils, topic, topicProps);
});
} catch (final Exception e) {
throw new TopicConfigException("Unable to update retention time for topic " + topic, e);
}
}
Aggregations