Skip to content
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

feat: Added kafka service #1565

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat: Added kafka service #1565

wants to merge 9 commits into from

Conversation

Alexnortung
Copy link
Contributor

Here is a rough implementation of a kafka service for devenv.

I think there are definetely place for configuration options. but I am not sure how we can implement this properly. So feedback would be appreciated :)

closes #1563

@Alexnortung Alexnortung changed the title feat: WIP: Added kafka feat: Added kafka Oct 31, 2024
@Alexnortung Alexnortung changed the title feat: Added kafka feat: Added kafka service Oct 31, 2024
@Alexnortung
Copy link
Contributor Author

Update: I have added initial connectors to kafka connect, but they don't seem to persist when i restart kafka connect, not sure why.

@Alexnortung
Copy link
Contributor Author

Okay, I figured it out, you could just pass the connectors to the start command

@sandydoo
Copy link
Member

Take a look at https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/misc/apache-kafka.nix. You should be able to reuse large parts of this, particularly the config/settings handling, and ideally keep a similar interface.

@Alexnortung
Copy link
Contributor Author

Alexnortung commented Nov 1, 2024

Hey @sandydoo thanks for the feedback!
I have now used many of the options provided in the NixOS module. However I have tweaked some defaults, so that it just works without having the user configure anything but enable = true.

I probably also need to create settings for kafka connect.

I would also like to have some kind of readiness probe for kafka.

TODO:

  • settings for kafka connect
  • readiness probe for kafka
  • make kafka connect start after kafka

@Alexnortung Alexnortung marked this pull request as draft November 1, 2024 10:03
@sandydoo
Copy link
Member

sandydoo commented Nov 1, 2024

However I have tweaked some defaults, so that it just works without having the user configure anything but enable = true.

That's the right approach.

@Alexnortung, is there a basic test we could add for this to make sure it launches? I'm not familiar with Kafka, but maybe a ping/healthcheck/queue-unqueue type of thing. See the examples and tests directories.

@Alexnortung
Copy link
Contributor Author

Hi @sandydoo I have Added settings to kafka connect and added a test for kafka.
I also wanted to add readiness probe to kafka, but it seems like something weird is going on when you add readiness probe to the service. Do you have any suggestions?

@Alexnortung Alexnortung marked this pull request as ready for review November 1, 2024 12:25
@@ -0,0 +1,3 @@
set -e

kafka-topics.sh --list --bootstrap-server localhost:9092
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does kafka-topics.sh come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's part of the apacheKafka package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer we could probably also do a curl since the script is probably just calling an endpoint in kafka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apache Kafka service
3 participants