Current state: Draft
Kafka TestKit library
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Users of Kafka in the JVM often write integration tests involving a Kafka cluster that is launched in the same JVM process. It would be helpful for such users if Kafka were to provide a public Java API as a separate library that would make it simple to start/stop a Kafka cluster in integration tests. Additionally, it should be easy to launch the cluster with TLS and/or SASL enabled.
We will introduce a small number of classes in the
testkit package, which will be considered public API. That is, we will only make incompatible changes in major releases after a suitable deprecation period.
We will introduce a new artifact called kafka-testkit that will contain the Java classes for the test library. This module will depend on the clients and core kafka artifacts, but it won't depend on any of the Kafka test artifacts. As such, users won't have our tests on their classpath.
Compatibility, Deprecation, and Migration Plan
Since this is a new library, there is no compatibility issue. Going forward, we will have to evolve the library carefully so that compatibility is maintained.
- Continue with the status quo where users who want to write integration tests involving a Kafka cluster have to rely on internal APIs.