public static void main(String[] args) throws Exception {
        try {
            Path tikaConfig = Paths.get(args[0]);
            long maxForEmitBatchBytes = Long.parseLong(args[1]);
            long serverParseTimeoutMillis = Long.parseLong(args[2]);
            long serverWaitTimeoutMillis = Long.parseLong(args[3]);

            PipesServer server =
                    new PipesServer(tikaConfig, System.in, System.out, maxForEmitBatchBytes,
                            serverParseTimeoutMillis, serverWaitTimeoutMillis);
            System.setIn(UnsynchronizedByteArrayInputStream.builder().setByteArray(new byte[0]).get());
            System.setOut(System.err);
            Thread watchdog = new Thread(server, "Tika Watchdog");
            watchdog.setDaemon(true);
            watchdog.start();

            server.processRequests();
        } finally {
            LOG.info("server shutting down");
        }
    }
This server is forked from the PipesClient.  This class isolates
parsing from the client to protect the primary JVM.
<p>
When configuring logging for this class, make absolutely certain
not to write to STDOUT.  This class uses STDOUT to communicate with
the PipesClient.
tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java