use of org.finos.symphony.toolkit.spring.api.health.AgentHealthHelper in project spring-bot by finos.
the class DefaultApiInstanceFactory method createApiInstance.
@Override
public ApiInstance createApiInstance(SymphonyIdentity id, PodProperties pp, TrustManager[] trustManagers) throws Exception {
ApiInstance parent = super.createApiInstance(id, pp, trustManagers);
ApiBuilder agentApiBuilder = ((BasicAPIInstance) parent).agentApiBuilder;
AgentHealthHelper agentHealth = new AgentHealthHelper(agentApiBuilder);
HealthCheckingApiInstance out = new HealthCheckingApiInstance(parent, agentHealth);
if (registry != null) {
String healthIndicatorName = "symphony-api-" + id.getCommonName() + "-" + pp.getId();
if (registry.getContributor(healthIndicatorName) == null) {
registry.registerContributor(healthIndicatorName, out);
}
}
return out;
}
Aggregations