Hi,
I’m struggling to find the proper way to detect once a Camel route is
losing connectivity from source or destination endpoint. In other words, I’m
not seeing the correct health check status reported by the route.
For example, If I have a route that subscribes an AMQP endpoint (using a
factory), once I start the route, the connection to the source AMQP endpoint is
established and the route switches to status “started”.
If I shutdown the AMQP source, the health check from Spring actuator is
correctly reporting the endpoint as “DOWN”.
But the route doesn’t change the status (as expected).
Looking at the registered health check components I don’t see any of them as
DOWN
I used this snipped to check the status of the route/consumers/producers
HealthCheckRegistry healthCheckRegistry =
HealthCheckHelper.getHealthCheckRegistry(camelContext);
healthCheckRegistry.getCheckIDs().forEach(id ->
healthCheckRegistry.getCheck(id).ifPresent(healthCheck -> {
Result result = healthCheck.call();
Result resultLiveness = healthCheck.callLiveness();
Result resultReadiness = healthCheck.callReadiness();
logger.info("Id: {} => {} - {} - {} - {}", id,
healthCheck.getGroup(),
result!=null ? result.getState() : "N/A",
resultLiveness!=null ? resultLiveness.getState() : "N/A", resultReadiness!=null
? resultReadiness.getState() : "N/A");
}));
It’s not clear to me how I can detect correctly if a route is working fine, so
every part of its chain is running properly, or not.
Any suggestion is welcome!
Riccardo