From: Kai Moritz Date: Sat, 15 Jun 2024 11:05:29 +0000 (+0200) Subject: Introduced service `popular` X-Git-Tag: wordcount-2.1.0 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=aa49f65a1881f3005f0390cec268d9e42342d469;p=demos%2Fkafka%2Fwordcount Introduced service `popular` --- diff --git a/.gitmodules b/.gitmodules index b8abc8d..0126226 100644 --- a/.gitmodules +++ b/.gitmodules @@ -29,3 +29,7 @@ [submodule "splitter"] path = splitter url = ./ +[submodule "popular"] + path = popular + url = ./ + branch = popular diff --git a/README.sh b/README.sh index 9aef18e..12ee1d3 100755 --- a/README.sh +++ b/README.sh @@ -7,6 +7,7 @@ SPLITTER=juplo/wordcount--splitter:1.2.0 COUNTER=juplo/wordcount--counter:1.3.1 TOP10=juplo/wordcount--top10:1.2.1 QUERY=juplo/wordcount--query:2.0.1 +POPULAR=juplo/wordcount--popular:1.0.0 if [ "$1" = "cleanup" ] then @@ -18,6 +19,7 @@ then docker image rm $COUNTER docker image rm $TOP10 docker image rm $QUERY + docker image rm $POPULAR exit fi @@ -29,11 +31,12 @@ if [[ $(docker image ls -q $COUNTER) == "" || $(docker image ls -q $TOP10) == "" || $(docker image ls -q $QUERY) == "" || + $(docker image ls -q $POPULAR) == "" || "$1" = "build" ]] then mvn clean package || exit - docker compose rm -svf recorder users splitter counter top10 query + docker compose rm -svf recorder users splitter counter top10 query popular ( cd fortune; ./README.sh $FORTUNE; ) mvn -f recorder/pom.xml docker:build mvn -f users/pom.xml docker:build @@ -41,6 +44,7 @@ then mvn -f counter/pom.xml docker:build mvn -f top10/pom.xml docker:build mvn -f query/pom.xml docker:build + mvn -f popular/pom.xml docker:build else echo "Using existing images:" docker image ls $FORTUNE @@ -50,6 +54,7 @@ else docker image ls $COUNTER docker image ls $TOP10 docker image ls $QUERY + docker image ls $POPULAR fi diff --git a/counter b/counter index 58681eb..f9156ed 160000 --- a/counter +++ b/counter @@ -1 +1 @@ -Subproject commit 58681eb5c2ea655385c8209b07330e4ef0ab2c49 +Subproject commit f9156ed2e1f43b64d39cc39a13d12ca8c0d24219 diff --git a/docker-compose.yml b/docker-compose.yml index 1d0ab83..8a5aff4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -103,6 +103,17 @@ services: depends_on: - kafka + popular: + image: juplo/wordcount--popular:1.0.0 + labels: + - "traefik.enable=true" + - "traefik.http.routers.popular.rule=Host(`popular.localhost`)" + - "traefik.http.routers.popular.entrypoints=web" + environment: + juplo.wordcount.popular.bootstrap-server: kafka:9092 + depends_on: + - kafka + bart: image: juplo/wordcount--fortune:1.0.1 @@ -165,6 +176,7 @@ services: kafka-topics --bootstrap-server kafka:9092 --describe --topic words kafka-topics --bootstrap-server kafka:9092 --describe --topic countings kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 + kafka-topics --bootstrap-server kafka:9092 --describe --topic popular else kafka-topics --bootstrap-server kafka:9092 \ --delete \ @@ -186,6 +198,10 @@ services: --delete \ --if-exists \ --topic top10 + kafka-topics --bootstrap-server kafka:9092 \ + --delete \ + --if-exists \ + --topic popular kafka-topics --bootstrap-server kafka:9092 \ --create \ --topic users \ @@ -226,6 +242,14 @@ services: --config min.insync.replicas=1 \ && echo Das Topic \'top10\' wurde erfolgreich angelegt: \ && kafka-topics --bootstrap-server kafka:9092 --describe --topic top10 \ + && kafka-topics --bootstrap-server kafka:9092 \ + --create \ + --topic popular \ + --partitions 3 \ + --replication-factor 1 \ + --config min.insync.replicas=1 \ + && echo Das Topic \'popular\' wurde erfolgreich angelegt: \ + && kafka-topics --bootstrap-server kafka:9092 --describe --topic popular \ && date > INITIALIZED fi stop_grace_period: 0s diff --git a/pom.xml b/pom.xml index 81945f9..fe057b1 100644 --- a/pom.xml +++ b/pom.xml @@ -16,5 +16,6 @@ counter top10 query + popular diff --git a/popular b/popular new file mode 160000 index 0000000..e88db15 --- /dev/null +++ b/popular @@ -0,0 +1 @@ +Subproject commit e88db15eafe64ac083d066be29ad94058930bb5d