import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
+import com.google.gson.JsonIOException;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
+import com.google.gson.JsonSyntaxException;
import com.google.gson.TypeAdapterFactory;
import java.io.BufferedInputStream;
import reactor.core.publisher.Mono;
/**
- * Regularly refreshes the configuration from Consul or from a local
- * configuration file.
+ * Regularly refreshes the configuration from Consul or from a local configuration file.
*/
@Component
public class RefreshConfigTask {
}
private Mono<JsonObject> getFromCbs(CbsClient cbsClient) {
- final CbsRequest getConfigRequest = CbsRequests.getAll(RequestDiagnosticContext.create());
try {
+ final CbsRequest getConfigRequest = CbsRequests.getAll(RequestDiagnosticContext.create());
return cbsClient.get(getConfigRequest) //
.onErrorResume(this::ignoreErrorMono);
} catch (Exception e) {
appParser.parse(rootObject);
logger.debug("Local configuration file loaded: {}", filepath);
return Flux.just(rootObject);
- } catch (IOException | ServiceException e) {
+ } catch (Exception e) {
logger.error("Local configuration file not loaded: {}, {}", filepath, e.getMessage());
return Flux.empty();
}