Fehler in Shutdown-Logik für den `ExecutorService` korrigiert
authorKai Moritz <kai@juplo.de>
Sat, 30 Apr 2022 09:36:13 +0000 (11:36 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 30 Apr 2022 09:36:13 +0000 (11:36 +0200)
src/main/java/de/juplo/kafka/Application.java

index 6601e6d..b5bd1b9 100644 (file)
@@ -46,12 +46,12 @@ public class Application implements ApplicationRunner
     }
     finally
     {
-      if (!executor.isShutdown())
+      if (!executor.isTerminated())
       {
         log.warn("Forcing shutdown of ExecutorService!");
         executor
             .shutdownNow()
-            .forEach(runnable -> log.warn("Unfinished task: {}", runnable.getClass().getSimpleName()));
+            .forEach(runnable -> log.warn("Unprocessed task: {}", runnable.getClass().getSimpleName()));
       }
       log.info("Shutdow of ExecutorService finished");
     }