From 0a23b208086aa3617f75d48e4e1b286cfdf9e64d Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 19 Nov 2022 17:04:47 +0100 Subject: [PATCH] Vorlage --- README.sh | 11 ++--------- src/main/java/de/juplo/kafka/SimpleConsumer.java | 3 +-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/README.sh b/README.sh index d63d229..7bcc996 100755 --- a/README.sh +++ b/README.sh @@ -34,20 +34,13 @@ while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Wait while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer-1..."; sleep 1; done while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer-2..."; sleep 1; done -# tag::nachrichten[] echo 6 | http -v :8080/peter echo 77 | http -v :8080/klaus -# end::nachrichten[] echo "Writing logic error..." -# tag::logicerror[] echo 66 | http -v :8080/peter?error=1 -# end::logicerror[] echo 7 | http -v :8080/klaus +sleep 5 +docker-compose -f docker/docker-compose.yml stop consumer-1 consumer-2 docker-compose -f docker/docker-compose.yml logs -f consumer-1 consumer-2 - -echo "Restarting consumer-1..." -# tag::restart[] -docker-compose -f docker/docker-compose.yml up consumer-1 -# end::restart[] diff --git a/src/main/java/de/juplo/kafka/SimpleConsumer.java b/src/main/java/de/juplo/kafka/SimpleConsumer.java index cea9568..82d6794 100644 --- a/src/main/java/de/juplo/kafka/SimpleConsumer.java +++ b/src/main/java/de/juplo/kafka/SimpleConsumer.java @@ -56,8 +56,7 @@ public class SimpleConsumer implements Callable } catch(Exception e) { - log.error("{} - Unexpected error: {}, unsubscribing!", id, e.toString()); - consumer.unsubscribe(); + log.error("{} - Unexpected error: {}!", id, e.toString()); return 1; } finally -- 2.20.1