Closed SingKS8 closed 6 months ago
@SingKS8 Looks like this might be something related to your environment. I am able to run your test both on the IDE and on the command line using the following two commands:
./mvnw clean package
./mvnw clean package -Dtest=xyz.opcal.demo.KafkaStreamDemoApplicationTests
If you still think something is wrong, please provide specific instructions to reproduce the issue. Thanks!
I have fix the demo docker compose config in testing, maybe my testcase function is just waiting the topic comsuming, it can not reflect the exceptions in bean initialization, then the test result is still success. So in my environment, both macos and linux desktop, JDK 21.0.3, in the test phase, I still got the exceptions above.
Because my testcase is useless, would you please check the log info, are there any consumer log like below in your test phase instead of exception.
2024-05-02T21:57:10.536+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [91-100]=12
2024-05-02T21:57:10.537+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [41-50]=18
2024-05-02T21:57:10.538+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [21-30]=10
2024-05-02T21:57:10.539+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [51-60]=17
2024-05-02T21:57:10.543+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [61-70]=13
2024-05-02T21:57:10.543+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [31-40]=16
2024-05-02T21:57:10.543+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [11-20]=22
2024-05-02T21:57:10.544+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [71-80]=6
2024-05-02T21:57:10.544+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [0-10]=20
2024-05-02T21:57:10.544+08:00 INFO 20008 --- [kafka-stream-demo] [-StreamThread-1] consumer : **** [81-90]=16
My testing only got exceptions instead of those consumer log. If there are those logs in your test phase, I have to reset my environment. Thanks for your support!
Yes, I can see a lot of Kafka/Kafka Streams related consumer logs as above.
Thanks for your support, I'll close this issue and review my project.
Here is my demo project https://github.com/SingKS8/kafka-stream-demo . I have updated spring boot 3.2.4 and Spring cloud 2023.0.1 aka spring cloud stream 4.1.1 in my demo project which is a demo about spring cloud function, stream binding and kafka streams binder.
If I am running it as a application starting, like
./mvnw spring-boot:run
; it is fine, there is no exception.But if I am running the JUnit testcase I have got some class cast exceptions about "create producer binding" and "create consumer binding" like below.
I have downgraded the spring boot to 3.2.3 for testing, I still get those exceptions.