Child pages
  • KIP-139: Kafka TestKit library
Skip to end of metadata
Go to start of metadata

Status

Current stateDraft

Discussion thread:

JIRA: KAFKA-5041 - Kafka TestKit library Open

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

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.

Public Interfaces

We will introduce a small number of classes in the org.apache.kafka.testkit package, which will be considered public API. That is, we will only make incompatible changes in major releases after a suitable deprecation period.


EmbeddedBroker.java


EmbeddedCluster.java
TestAdmin.java
TimeUtils.java
SslConfigBuilder.java
SaslConfigBuilder.java


Proposed Changes

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.

Rejected Alternatives

  1. Continue with the status quo where users who want to write integration tests involving a Kafka cluster have to rely on internal APIs.

 

  • No labels