public static void main(String[] args) {
        long start = System.currentTimeMillis();
        if (args.length < 6) {
            System.err.println(StrawManTikaAppDriver.usage());
        }
        Path inputDir = Paths.get(args[0]);
        Path outputDir = Paths.get(args[1]);
        int totalThreads = Integer.parseInt(args[2]);
        Path fileList = null;
        if (args.length > 3) {
            fileList = Paths.get(args[3]);
            if (!Files.isReadable(fileList)) {
                fileList = null;
            }
        }

        int initialParams = (fileList == null) ? 3 : 4;
        List<String> commandLine = new ArrayList<>(Arrays
                .asList(args)
                .subList(initialParams, args.length));
        totalThreads = Math.max(totalThreads, 1);
        ExecutorService ex = Executors.newFixedThreadPool(totalThreads);
        ExecutorCompletionService<Integer> completionService = new ExecutorCompletionService<>(ex);

        for (int i = 0; i < totalThreads; i++) {
            StrawManTikaAppDriver driver = new StrawManTikaAppDriver(inputDir, outputDir, totalThreads, fileList, commandLine.toArray(new String[0]));
            completionService.submit(driver);
        }

        int totalFilesProcessed = 0;
        for (int i = 0; i < totalThreads; i++) {
            try {
                Future<Integer> future = completionService.take();
                if (future != null) {
                    totalFilesProcessed += future.get();
                }
            } catch (InterruptedException | ExecutionException e) {
                LOG.error(e.getMessage(), e);
            }
        }
        double elapsedSeconds = (double) (System.currentTimeMillis() - start) / (double) 1000;
        LOG.info("Processed {} in {} seconds", totalFilesProcessed, elapsedSeconds);
        ex.shutdownNow();
    }
Simple single-threaded class that calls tika-app against every file in a directory.
<p>
This is exceedingly robust.  One file per process.
<p>
However, you can use this to compare performance against tika-batch fs code.
tika-batch/src/main/java/org/apache/tika/batch/fs/strawman/StrawManTikaAppDriver.java