testcontainers-go
testcontainers-go copied to clipboard
feat(kafka): use new apache/kafka-native docker image
What does this PR do?
Uses the new apache/kafka-native docker image instead of the confluent local docker image. The kafka native docker image is much faster (startup time is maybe a second once the image is downloaded).
Trying to see if there is a desire from the community to use this. I can also add support for authentication mechanisms like SASL_PLAINTEXT if desired.
A current limitation of this however is that the desired host port must be known at container creation time - unlike before where we could dynamically pick a port at runtime. The way it was done before was a bit strange, it was running a kafka instance after the container had already started up I believe, which allowed it to pick the right port to use. Here, when we start up the kafka container it must know the port already.
We can still support picking random ports with some tricks like this, but there's no guarantee there won't be collisions.
Also I realize some of these changes may cause unavoidable breaking changes, so I'm happy to make a v2 module.