in iep-spring-dynconfig/src/main/java/com/netflix/iep/dynconfig/DynamicConfigService.java [98:126]
boolean update() {
try {
LOGGER.debug("updating properties from {}", uri);
HttpResponse response = HttpClient.DEFAULT_CLIENT.get(uri).send();
if (response.status() == 200) {
try (InputStream in = new ByteArrayInputStream(response.entity())) {
final Properties props = new Properties();
props.load(in);
if (LOGGER.isTraceEnabled()) {
props.stringPropertyNames().forEach(
k -> LOGGER.trace("received property: [{}] = [{}]", k, props.getProperty(k)));
}
updateDynamicConfig(props);
lastUpdateTime.set(System.currentTimeMillis());
}
} else {
throw new IOException("request failed with status: " + response.status());
}
return true;
} catch (Exception e) {
LOGGER.warn("failed to update dynamic properties", e);
return false;
}
}