private void shutdownConsumersManager() {
        if (consumersManagerMaxMillis < 0) {
            consumersManager.shutdown();
            return;
        }
        Thread timed = new Thread(() -> {
            LOG.trace("starting to shutdown consumers manager");
            consumersManager.shutdown();
            LOG.trace("finished shutting down consumers manager");
        });
        timed.setDaemon(true);
        timed.start();
        try {
            timed.join(consumersManagerMaxMillis);
        } catch (InterruptedException e) {
            LOG.warn("interruption exception during consumers manager shutdown");
        }
        if (timed.isAlive()) {
            LOG.error("ConsumersManager was still alive during shutdown!");
            throw new BatchNoRestartError("ConsumersManager did not shutdown within: " + consumersManagerMaxMillis + "ms");
        }
    }
Runs main execution loop.
<p>
Redirects stdout to stderr to keep clean communications
over stdout with parent process

@return result of the processing
@throws InterruptedException
tika-batch/src/main/java/org/apache/tika/batch/BatchProcess.java