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

Support to consume from all partitions #12

Closed
fmck3516 opened this issue Jun 29, 2021 · 7 comments
Closed

Support to consume from all partitions #12

fmck3516 opened this issue Jun 29, 2021 · 7 comments

Comments

@fmck3516
Copy link
Contributor

Hi - are there plans to add support to consume from all partitions? I took a quick glance at consumer.go and it looks like the current implementation only allows to consume from one partition.

@mostafa
Copy link
Owner

mostafa commented Jun 29, 2021

Hey @fmck3516,

TLDR;
I already mentioned a few optimizations/refactoring tips in this #9 (comment). I originally developed k6-plugin-kafka as a POC to demonstrate the capabilities of the plugin support PR suggested by the awesome @andremedeiros. My original intention was to write a Kafka load-testing tool in Rust, though. Then the k6 team decided to ditch that PR and work on an extension system based on xcaddy, which resulted in xk6. So, I migrated my original code to work as an xk6 extension. Some of the issues you see are due to the fact that it was a POC, and others are due to the old code from the plugin system.

Long story short, I am more than happy to refactor this code and make it look more like Go code with Go best practices, meaning: I am happy to see PRs on this.

@fmck3516
Copy link
Contributor Author

Long story short, I am more than happy to refactor this code and make it look more like Go code with Go best practices, meaning: I am happy to see PRs on this.

Thanks for the context. I will raise a PR.

Even though xk6-kafka is not ready for prime time yet: I'm pretty confident that we can turn this into something that provides a lot of value for a lot of people if we push it beyond the POC state.

mostafa added a commit that referenced this issue Jul 4, 2021
@mostafa
Copy link
Owner

mostafa commented Jul 4, 2021

@fmck3516
I'd be happy to have your feedback on the new changes. I added createTopic and listTopics functions and also added groupID to reader signature. I particularly tested createTopic and listTopics function with scripts/test_topics.js script, but I haven't tested the groupID feature.

@fmck3516
Copy link
Contributor Author

fmck3516 commented Jul 6, 2021

Thanks - I will do a review later today.

@mostafa
Copy link
Owner

mostafa commented Jul 14, 2021

@fmck3516 Any luck with testing this?

@fmck3516
Copy link
Contributor Author

fmck3516 commented Jul 15, 2021

Just tested it:

const consumer = reader(bootstrapServers, topic, null, "g1", 0, auth);

The script is now consuming from multiple partitions (and I see the consumer group g1 in the Confluent Cloud dashboard):
consumer-group

👍

@mostafa
Copy link
Owner

mostafa commented Jul 15, 2021

WOW! Nice! 👏
I've released a new version: https://github.com/mostafa/xk6-kafka/releases/tag/0.5.0

@mostafa mostafa moved this to Release in xk6-kafka May 10, 2022
mostafa added a commit that referenced this issue May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Release
Development

No branches or pull requests

2 participants