Version 1.0.0 of Kafka for Junit has been released. It features a couple of small improvements and bugfixes but most notably works now with Kafka 1.1.x and adds two significant epics Multiple Brokers and Failure Modes as well as an extended queriability when reading from or observing a topic, since both operations now accept a filter on record headers. With this release, it is possible to provision an embedded cluster with multiple brokers. This led to the possiblity to introduce failure modes on the broker-level as well:
EmbeddedKafkaCluster provides a set of methods that allow you to disconnect specific brokers or disconnect as many brokers as required to fall below the minimum size of the In-Sync-Replica Set of a dedicated topic. This enables you to test if your Kafka-enabled component or application behaves correctly in the presence of broker outages.
See the changelog on GitHub.
- #6: Add the possibility to instantiate multiple Kafka brokers
- #9: Increase Apache Kafka dependency to 1.1.0
- #21: Add a minimal Kafka Connect worker for testing the Kafka Connect provisioning
- #22: Update dependencies
- #23: Provide the means to filter on record headers and their values
- #24: Fetch current broker assignments for a topic via TopicManager
- #25: Provide the means to deactivate and reactivate a single embedded Kafka broker
- #26: Disconnect and re-connect a specific embedded Kafka broker
- #27: Disconnect brokers until the ISR falls below its minimum ISR
- #28: Re-connect brokers such that the minimum ISR size for a topic is met
- #29: Add a configuration parameter that lets transactional writes fail on purpose
- #30: DefaultTopicManager resp. TopicConfig should use partition and replication defaults from broker configuration
- #31: TopicConfig does not retain overridden parameters
You can obtain the binaries from Maven central or include the dependency using the following Maven coordinates in your build.
Bugfixes are also available for 0.1.x (as 0.1.1), 0.2.x (as 0.2.1) as well as 0.3.x (as 0.3.1). Please use these bugfix releases if you are not able to upgrade to Kafka for JUnit 1.0.0 just yet.
<dependency> <groupId>net.mguenther.kafka</groupId> <artifactId>kafka-junit</artifactId> <version>1.0.0</version> </dependency>