@Override protected boolean runningAllowed() { // we can stop quickly if CamelContext is being stopped, and we do not accept messages while stopping // this allows a more cleanly shutdown of the message listener boolean quickStop = false; if (isAllowQuickStop() && !endpoint.isAcceptMessagesWhileStopping()) { quickStop = endpoint.getCamelContext().getStatus().isStopping(); } if (quickStop) { // log at debug level so its quicker to see we are stopping quicker from the logs logger.debug("runningAllowed() -> false due CamelContext is stopping and endpoint configured to not accept messages while stopping"); return false; } else { // otherwise we only run if the endpoint is running boolean answer = endpoint.isRunning(); // log at trace level as otherwise this can be noisy during normal operation logger.trace("runningAllowed() -> " + answer); return answer; } }