-
-
Notifications
You must be signed in to change notification settings - Fork 580
feat(kafka_native): new module #3249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
eabd044
to
b4dcd24
Compare
For comparison: on my machine currently, $ cd modules/kafka_native && go test -timeout 30s -count 1 -run '^TestKafka$' github.com/testcontainers/testcontainers-go/modules/kafka_native ; cd -
ok github.com/testcontainers/testcontainers-go/modules/kafka_native 3.693s
$ cd modules/kafka && go test -timeout 30s -count 1 -run '^TestKafka$' github.com/testcontainers/testcontainers-go/modules/kafka ; cd -
ok github.com/testcontainers/testcontainers-go/modules/kafka 16.654s Tests themselves are identical, only different images and less confluent-dependant configs. |
b4dcd24
to
b044a54
Compare
b044a54
to
1ef2f84
Compare
Hi @strowk thanks for adding this! I'm currently taking a look, also discussing internally with the other TC maintainers if this code should live as a new sub-package under the kafka module. What are your thoughts on this? |
Sounds ok, though not sure what would interface look like |
Hmmm thinking more in depth about the submodule, will the existing kafka options apply to this native image? If so, then we should probably find them, although it can be probably done in a follow-up. |
What does this PR do?
Adding new module: kafka_native, that should be a much faster alternative to existing kafka module based on confluent kafka.
Why is it important?
Put simply Kafka Native is blazingly fast. It is based on GraalVM in native mode, which compiles Java code into native binary. This translates into very fast starting time and starting time is what always important in tests (unlike in runtime) and what is normally very slow for Java. In my relatively simple tests on my relatively powerful machine, the improvement is from 16.6 seconds to 3.6 seconds. Translate this into say 100 tests and the improvement can be measured in minutes if not hours for big projects.
This change also can fix this issue due to changed way of starting the process: #2206
Related issues
How to test this PR
Explain here how this PR will be tested by the reviewer: commands, dependencies, steps, etc.
Additional Context
There is also another PR, that attempts to add support for Kafka Native into pre-existing module: #2683
Here is a brief list of differences in approaches: