use of org.apache.camel.health.HealthCheckRegistry in project camel-quarkus by apache.
the class MicroProfileHealthResource method healthCheckEnabled.
@Path("/{healthCheckId}")
@POST
public void healthCheckEnabled(@PathParam("healthCheckId") String healthCheckId, @QueryParam("healthCheckEnabled") boolean isHealthCheckEnabled) {
HealthCheckRegistry registry = camelContext.getExtension(HealthCheckRegistry.class);
registry.getCheck(healthCheckId).ifPresent(healthCheck -> {
healthCheck.getConfiguration().setEnabled(isHealthCheckEnabled);
if (isHealthCheckEnabled) {
registry.register(healthCheck);
} else {
registry.unregister(healthCheck);
}
});
}
use of org.apache.camel.health.HealthCheckRegistry in project camel-quarkus by apache.
the class MicroProfileHealthEnabledTest method healthCheckRegistryNotNull.
@Test
public void healthCheckRegistryNotNull() {
HealthCheckRegistry registry = HealthCheckRegistry.get(context);
assertNotNull(registry);
assertTrue(registry instanceof CamelMicroProfileHealthCheckRegistry);
assertEquals("camel-microprofile-health", registry.getId());
}
Aggregations