/** * Start consuming data from the stream, and pass it to the application record processors. */ public void run() { if (shutdown) { return; } try { initialize(); LOG.info("Initialization complete. Starting worker loop."); } catch (RuntimeException e1) { LOG.error("Unable to initialize after " + MAX_INITIALIZATION_ATTEMPTS + " attempts. Shutting down.", e1); shutdown(); } while (!shouldShutdown()) { runProcessLoop(); } finalShutdown(); LOG.info("Worker loop is complete. Exiting from worker."); }