}
}
// prepare for shutdown
for (ShutdownDeferredConsumer deferred : deferredConsumers) {
Consumer consumer = deferred.getConsumer();
if (consumer instanceof ShutdownAware) {
LOG.trace("Route: {} preparing to shutdown.", deferred.getRoute().getId());
boolean forced = context.getShutdownStrategy().forceShutdown(consumer);
boolean suppress = context.getShutdownStrategy().isSuppressLoggingOnTimeout();
prepareShutdown(consumer, forced, false, suppress);
LOG.debug("Route: {} preparing to shutdown complete.", deferred.getRoute().getId());
}
}
// now all messages has been completed then stop the deferred consumers
for (ShutdownDeferredConsumer deferred : deferredConsumers) {
Consumer consumer = deferred.getConsumer();
if (suspendOnly) {
suspendNow(consumer);
LOG.info("Route: {} suspend complete, was consuming from: {}", deferred.getRoute().getId(), deferred.getConsumer().getEndpoint());
} else {
shutdownNow(consumer);