quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.94k stars 1.44k forks source link

Kafka-Streams-quickstart example does not work as expected #1318

Open omnipresent07 opened 1 year ago

omnipresent07 commented 1 year ago

Describe the bug

When running the kafka streams example here: https://quarkus.io/guides/kafka-streams the http endpoint for the aggregator doesn't work. Below is the output that we are getting.

Screenshot 2023-03-04 at 4 46 25 PM

Expected behavior

When running the http aggregator:8080/weather-stations/data/1 endpoint from the debezium tooling docker container we get a 404 . When following the logs for the aggregator rest service in docker we see this warn message:

2023-03-04 21:49:41,752 WARN  [org.acm.kaf.str.agg.str.InteractiveQueries] (executor-thread-0) Found no metadata for key 1

Actual behavior

instead of the 404 we should be getting the data back from the kafka streams aggregator. When viewing the kafka data in the aggregator topic we can actually see the data:

Screenshot 2023-03-04 at 4 51 31 PM

How to Reproduce?

1 - git clone the examples: git clone https://github.com/quarkusio/quarkus-quickstarts.git 2 - cd quarkus-quickstarts 3 - cd kafka-streams-quickstart 4 - run mvn clean install 5 - run docker-compose up -d --build 6 - run docker run --tty --rm -i --network ks debezium/tooling:1.1 7 - from inside the debezium shell run: http aggregator:8080/weather-stations/data/1

Output of uname -a or ver

Darwin Bhaarats-MBP 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "13.0.2" 2020-01-14 OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.2+8) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.2+8, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.16.4.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584) Maven home: /usr/local/Cellar/maven/3.9.0/libexec Java version: 19.0.2, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk/19.0.2/libexec/openjdk.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "13.2.1", arch: "x86_64", family: "mac"

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @alesj (kafka,kafka-streams), @cescoffier (kafka), @gunnarmorling (kafka-streams), @ozangunalp (kafka,kafka-streams), @rquinio (kafka-streams)

0815Hunter commented 4 months ago

Had the same problem and found the fix by reading: https://docs.confluent.io/platform/current/streams/developer-guide/interactive-queries.html#exposing-the-rpc-endpoints-of-your-application

The application-server config prop is missing in the application.properties of the example aggregator app, even though mentioned in the quarkus kafka streams guide.

Just set it like this: quarkus.kafka-streams.application-server=${hostname}:8080