From: Kai Moritz Date: Sat, 30 Apr 2022 09:36:13 +0000 (+0200) Subject: Fehler in Shutdown-Logik für den `ExecutorService` korrigiert X-Git-Tag: wip-DEPRECATED~11^2^2~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c2ed5c937b94f61b40ee9e329bf80b0a62fb4fbc;p=demos%2Fkafka%2Ftraining Fehler in Shutdown-Logik für den `ExecutorService` korrigiert --- diff --git a/src/main/java/de/juplo/kafka/Application.java b/src/main/java/de/juplo/kafka/Application.java index 6601e6d..b5bd1b9 100644 --- a/src/main/java/de/juplo/kafka/Application.java +++ b/src/main/java/de/juplo/kafka/Application.java @@ -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"); }