Add AtomicBoolean to stop processing loop when ShutdownHook is triggered