Version 2.5.1 of Kafka for JUnit has been released. It contains a bugfix for issue #48. This issue caused brokers to change their port after re-activating. The broker port will now stay the same. Furthermore, kafka-junit raises a warning if you try to configure a multi-broker embedded cluster but try to assign a dedicated port to all of them via the
See the changelog on GitHub.
- #48: Broker address changes after disconnecting and reconnecting brokers in an embedded Kafka cluster
You can obtain the binaries from Maven central or include the dependency using the following Maven coordinates in your build.
<dependency> <groupId>net.mguenther.kafka</groupId> <artifactId>kafka-junit</artifactId> <version>2.5.1</version> </dependency>