in services/bff/src/main/java/com/example/bff/BffController.java [74:110]
public void init() {
logger.info("BffController: Post Construct Initializer");
if(referenceURL==null){
logger.error("Reference Service URL has not been configured. Please set the QUOTES_URL env variable");
StartupCheck.down();
}
if(quotesURL==null){
logger.error("Quotes Service URL has not been configured. Please set the QUOTES_URL env variable");
StartupCheck.down();
}
// build the HTTP client
ok = new OkHttpClient.Builder()
.readTimeout(read, TimeUnit.MILLISECONDS)
.writeTimeout(write, TimeUnit.MILLISECONDS)
.build();
// retrieve metadata at startup
if(metadata == null) {
try {
ResponseBody data = ServiceRequests.makeAuthenticatedRequest(ok, referenceURL,
"metadata");
metadata = data.string();
logger.info("Metadata:" + metadata);
} catch (IOException e) {
logger.error("Unable to get Reference service data", e);
// fail the startup actuator
StartupCheck.down();
return;
}
}
// enable the startup actuator
StartupCheck.up();
}