-
Notifications
You must be signed in to change notification settings - Fork 162
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
Use api versions for new api calls (depends on #319) #320
Use api versions for new api calls (depends on #319) #320
Conversation
081de12
to
0f58fbe
Compare
0f58fbe
to
b33aa60
Compare
This MR is now ready for review ! (as usual, I think the CI tests need to be restarted to allow them to pass) |
lib/kafka_ex/api_versions.ex
Outdated
def api_versions_map(api_versions) do | ||
api_versions | ||
|> Enum.map(fn version -> {version.api_key, version} end) | ||
|> Map.new |
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.
This function isn't supported by elixir 1.1
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.
thanks, I'll fix that. Any idea what to replace it with ?
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.
Nevermind :)
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.
From the logs of the CI, it seems I fixed that problem.
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.
Another option
Enum.into(api_versions, %{}, fn version -> {version.api_key, version} end)
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.
thanks, I keep forgetting about Enum.into
!
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.
This looks good to me.
Hey people ! Anybody else apart from Joshua would like to give an opinion on this ? It is rather important in the sense that it alters a bit the way the project will implement future features, following the lead of Kafka since 0.10. |
@jbruggem Thanks again! I'll try to get a release together soon |
See #318.
This MR replaces
server_0_p_10_p_1.ex
byserver_0_10_or_later.ex
and uses api versions to handle the API calls implemented in it.This would mean that from here on out, all messages of the API can be implemented without assuming the version of the server. All that is needed is to refer to the
api_versions
to check which is the greatest version of the message supported both by the server and the client.Follow-up to #319