stop();
loadConfigurationFromFile();
refreshTask = createRefreshTask() //
- .subscribe(notUsed -> logger.info("Refreshed configuration data"),
+ .subscribe(notUsed -> logger.debug("Refreshed configuration data"),
throwable -> logger.error("Configuration refresh terminated due to exception", throwable),
- () -> logger.error("Configuration refresh terminated"));
+ () -> logger.debug("Configuration refresh completed"));
}
public void stop() {
return cbsClient.updates(getConfigRequest, initialDelay, refreshPeriod);
}
- private <R> Mono<R> onErrorResume(Throwable trowable) {
- logger.error("Could not refresh application configuration {}", trowable.toString());
+ private <R> Mono<R> onErrorResume(Throwable throwable) {
+ String errMsg = throwable.toString();
+ logger.error("Could not refresh application configuration. {}", errMsg);
return Mono.empty();
}
/**
* Reads the configuration from file.
*/
- public void loadConfigurationFromFile() {
+ void loadConfigurationFromFile() {
String filepath = appConfig.getLocalConfigurationFilePath();
if (filepath == null) {
logger.debug("No localconfiguration file used");
try (InputStream inputStream = createInputStream(filepath)) {
JsonObject rootObject = getJsonElement(inputStream).getAsJsonObject();
- if (rootObject == null) {
- throw new JsonSyntaxException("Root is not a json object");
- }
ApplicationConfigParser appParser = new ApplicationConfigParser();
appParser.parse(rootObject);
appConfig.setConfiguration(appParser.getRicConfigs(), appParser.getDmaapPublisherConfig(),