spring-kafka
spring-kafka copied to clipboard
kafka test jars are included in spring-kafka-test
The tests jar of kakfa-clients and kafka-server-commons are included in spring-kafka-test. Both include a junit-platform.properties configuration file which results in WARNING: Discovered 2 'junit-platform.properties' configuration files in the classpath; only the first will be used.
I can't really find any reason why those test jars are included.
This is known issue: https://issues.apache.org/jira/browse/KAFKA-17121.
You can try to exclude those dependencies, but I think somewhere in the KafkaClusterTestKit hierarchy some of those classes are used.
We are right now in 4.0 generation, so we can revise some of those transitive dependencies for a minimum.
Might be the case that some of those were used for Zookeeper mode which is not there any more.
Ya, @artembilan, I was also curious about this issue and was looking. As you said, we can probably remove those dependencies and see what breaks in 4.0.
Well, I see that issue has been fixed in Kafka 3.9.0.
You can just upgrade your project to that one: https://docs.spring.io/spring-kafka/reference/appendix/override-boot-dependencies.html
I just ran our tests with both kafka-clients and kafka-server-common excluded from spring-kafka-test. That also does the job 😁. We run our tests with a Confluent Kafka container 😉
I am confused.
If you use Confluent Kafka container then you don't need embedded Kafka at all.
And might be the case that you don't need spring-kafka-test altogether.
That did a job for you because you don't use an @EmbeddedKafka in your project.
Therefore there might not be the pass where a call to those test artifacts would happen.
I'll check why spring-kafka-test is included in the project 👍
Closing the issue due to no recent activity. Please feel free to re-open if you need to.