From: Kai Moritz Date: Thu, 30 Jun 2022 16:53:46 +0000 (+0200) Subject: splitter: 1.0.0-vanilla-kafka - Fixed shutdown X-Git-Tag: wip-integration-xml~11 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=a3144e93ad95a87cfb33d261c2f6eb67062734c1;p=demos%2Fkafka%2Fwordcount splitter: 1.0.0-vanilla-kafka - Fixed shutdown * The shutdown was blocked, because tSplitterStreamProcessor.stop() was called twice. * The second time, it could no longer reach the cluster, hence, blocking the shutdown process. --- diff --git a/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java b/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java index fabae8f..0eafbda 100644 --- a/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java +++ b/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterStreamProcessor.java @@ -254,6 +254,11 @@ public class SplitterStreamProcessor implements Runnable public void stop() { log.info("Shutdown requested..."); + if (stopped) + { + log.warn("Ignoring request: already stopped!"); + return; + } stopped = true; consumer.wakeup(); running.lock();