Skip to content

feat: add kafka (KRaft mode only) module#1610

Merged
mdelapenya merged 19 commits intotestcontainers:mainfrom
mdelapenya:kafka-module
Sep 18, 2023
Merged

feat: add kafka (KRaft mode only) module#1610
mdelapenya merged 19 commits intotestcontainers:mainfrom
mdelapenya:kafka-module

Conversation

@mdelapenya
Copy link
Copy Markdown
Member

@mdelapenya mdelapenya commented Sep 12, 2023

What does this PR do?

This PR adds a Kafka module, as a result of updating #1034 by @noctarius to the new design for modules.

The module comes with:

  • a set of predefined env vars.
  • a custom script that is copied right after the container is started, starting Kafka in KRaft mode.
  • a wait strategy that is executed after the contianer is started and after the above file is copied.
  • a container method to get the broker URL for kafka.

We copied the Java module implementation, but providing support for KRaft-only:

  • validation of the lower version (7.0.0)
  • same wait.ForLog message
  • configure controller quorum voters based in the networks/aliases
  • support for setting the cluster ID

Why is it important?

A new module for a technology that is widely used

Related issues

@mdelapenya mdelapenya requested a review from a team as a code owner September 12, 2023 02:19
@mdelapenya mdelapenya added the feature New functionality or new behaviors on the existing one label Sep 12, 2023
@mdelapenya mdelapenya self-assigned this Sep 12, 2023
@netlify
Copy link
Copy Markdown

netlify bot commented Sep 12, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit d10d28e
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/65043b608db5270008cbd4ee
😎 Deploy Preview https://deploy-preview-1610--testcontainers-go.netlify.app/modules/kafka
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mdelapenya mdelapenya changed the title feat: add kafka module feat: add kafka (KRaft mode only) module Sep 12, 2023
@mdelapenya
Copy link
Copy Markdown
Member Author

@eddumelendez if you agree I0d like to proceed and merge this module, as it's clear that it uses kafka + KRaft. We can listen to the future feedback in the case we need to add support for Zookeeper mode. Thoughts?

@mdelapenya mdelapenya merged commit 9a340c3 into testcontainers:main Sep 18, 2023
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request Sep 18, 2023
* main:
  feat: add kafka (KRaft mode only) module (testcontainers#1610)
@mdelapenya mdelapenya deleted the kafka-module branch November 6, 2023 11:02
@ccampo133
Copy link
Copy Markdown

Why does Brokers return a slice when there is only ever a single element. Why not just return a string?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality or new behaviors on the existing one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Kafka module

2 participants