-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added multi version kafka support #655
Conversation
Tries to address IBM#617
That agrees with https://kafka.apache.org/protocol.html#protocol_messages, so I will update the wiki. |
The requests and responses should not store the actual kafka version (0.8.2 or 0.9 or whatever); they should store the actual API version number specific to them (see e.g. what The kafka version should be stored either as a global (next to |
@@ -8,8 +8,16 @@ import ( | |||
|
|||
var validID *regexp.Regexp = regexp.MustCompile(`\A[A-Za-z0-9._-]*\z`) | |||
|
|||
type KafkaVersion struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having both kVersion
and KafkaVersion
as structs seems like an unnecessary complication; can't you just make one type out of them?
I actually removed version number from Right now, Kafka version has been made part of the config in this PR. Since our discussion started with this, why not go ahead with it rather than implementing it as global. Test cases would need to be modified though which I have already partially hacked here in an ugly way. |
Superseded mostly by #676 (based on this code but simplified) and other work that is ongoing. Thanks for your input, it was helpful in solving this! |
Glad to be of help. Cheers! |
@eapache @wvanbergen This is the PR I have been working on to address #617. Can you guys start reviewing it please. I am originally from Python background so please ignore any coding horrors here.
Also checkout how different response versions are handled in
kafka-python
here. For this PR, I am passing kafka version from request to response so that response knows how to decode itself. Also, please do leave comments on the way kafka version is assigned in test cases. It doesn't look right IMO.Description:
Not implemented/missing/confused:
Issues:
Decoded request does not match the encoded one
. Any pointers would be highly appreciated. Failing tests:Gotchas:
I figured out that the BNF for FetchResponse v1 is actually
instead of
I think there is an error in the kafka protocol wiki here.