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

Choosing Schema Registry Subject Name Strategy #85

Closed
enamrik opened this issue Jun 10, 2022 · 6 comments
Closed

Choosing Schema Registry Subject Name Strategy #85

enamrik opened this issue Jun 10, 2022 · 6 comments
Assignees
Labels
✨ Feature Request New feature or request

Comments

@enamrik
Copy link
Contributor

enamrik commented Jun 10, 2022

Problem:

There are different naming strategies out there for naming the subject of a schema as seen here.

The schema registry implementation in this library hardcodes the TopicNameStrategy strategy as seen below.

subject := topic + "-" + string(element)

In my current project, we use a different strategy RecordNameStrategy. This is because we have topics that can contain messages of different schemas.

Request:

Can we consider allowing the user to pass a method that builds the subject name? This way the user can implement which ever naming strategy they use.

@mostafa mostafa added the ✨ Feature Request New feature or request label Jun 11, 2022
@mostafa
Copy link
Owner

mostafa commented Jun 11, 2022

Hey @enamrik,

thanks for pointing it out. I am thinking about exporting the whole functionality to JS. Please upvote the issue. I'd also be happy to see and review contributions. I'm currently working on fixing a bug with SASL and TLS. See the project board for updates, as I added this issue to the todo list.

There are other issues you might be interested:

@mostafa mostafa moved this to Todo in xk6-kafka Jun 11, 2022
@enamrik
Copy link
Contributor Author

enamrik commented Jun 14, 2022

Hi @mostafa, I gave it shot and tried adding support for subject name strategies: #88. I tried to keep the change footprint small but I do have some suggested refactorings if you're interested. Please let me know what you think.

I'm also exploring another need I have which is for the consumer to support the special offsets i.e. -1 = latest, -2 = earliest. I have the changes and test on a branch https://github.com/enamrik/xk6-kafka/blob/handle_special_offsets/consumer.go#L40. Wanted to get your thoughts on this first PR before attempting a PR on special offsets.

@mostafa
Copy link
Owner

mostafa commented Jun 14, 2022

@enamrik Awesome! Thanks for your contribution. 🙏
I'll try to review the PR as soon as I can and possibly merge it. Also, I'd be very happy to know more about your refactoring suggestions. Please check the tickets for known issues.

@enamrik
Copy link
Contributor Author

enamrik commented Jun 14, 2022

@enamrik Awesome! Thanks for your contribution. 🙏 I'll try to review the PR as soon as I can and possibly merge it. Also, I'd be very happy to know more about your refactoring suggestions. Please check the tickets for known issues.

Yes, now that I've added the features I needed for work and I'm more familiar with the codebase, I'd love to help on issues. I'll take a look at those you mentioned.

@mostafa mostafa moved this from Todo to Doing in xk6-kafka Jun 16, 2022
@mostafa mostafa moved this from Doing to Test in xk6-kafka Jun 16, 2022
@mostafa
Copy link
Owner

mostafa commented Jun 16, 2022

Thanks to @enamrik, the issue is addressed in #88.

@enamrik Feel free to re-open the issue if you have anything else to add.

@mostafa mostafa closed this as completed Jun 16, 2022
@mostafa
Copy link
Owner

mostafa commented Jun 20, 2022

Released in v0.11.0.

@mostafa mostafa moved this from Test to Release in xk6-kafka Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Request New feature or request
Projects
Status: Release
Development

No branches or pull requests

2 participants