-
Notifications
You must be signed in to change notification settings - Fork 277
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
fix: api_version #152
fix: api_version #152
Conversation
could you please describe the bug in detail? I'm not sure I'm catching up with you. |
if not self.api_version then
version = self.api_version
end First of all, the code means that Secondly, lua-resty-kafka/lib/resty/kafka/producer.lua Line 341 in 3fbed91
self.api_version will be API_VERSION_V0 if we not set manually.
So I implement it as "use self.api_version as version if it's set manually": if not (self.api_version == API_VERSION_V0) then
version = self.api_version
end |
okay, I see the problem. but I'm afraid this may not be a proper fix. actually, we hope to use I think the proper way is, you specify the api_version in your upper level code, while init the producer. Or, if you think |
|
@DG-Wangtao Thanks for your clearify.
does this work for you? |
yes. it works well if I set api_version while init the producer. I think use
I you agree with this idea I will update this pull request. |
Hi @doujiang24, I think this pull request is ready to merge, do you have any concerns? |
@DG-Wangtao Sorry for the late. |
the code logical in the current patch looks weird, if the new branch passes the CI, I prefer the new branch. |
Yes, logical in branch https://github.com/DG-Wangtao/lua-resty-kafka/tree/fix/api-version is a better way, which has been running in my env for a long time. I created a new pull request from the branch here #160 an passed the CI. @doujiang24 Thanks for your work, I'm closing this pull request. |
Hi @doujiang24 ,
I think I made a mistake in #137 while trying to resolve #135, so I'm creating a new pull request to fix it.