Make api_versions compatible with Elixir 1.1
MODIFY
lib/kafka_ex/api_versions.ex
lib/kafka_ex/api_versions.ex
@@ -2,10 +2,12 @@ defmodule KafkaEx.ApiVersions do
def api_versions_map(api_versions) do
api_versions
- |> Enum.map(fn version -> {version.api_key, version} end)
- |> Map.new
+ |> Enum.reduce(%{}, fn version, version_map ->
+ version_map |> Map.put(version.api_key, version)
+ end)
end
+
def find_api_version(api_versions_map, message_type, {min_implemented_version, max_implemented_version}) do
if api_versions_map == [:unsupported] do
{:ok, min_implemented_version}

MODIFY
lib/kafka_ex/server_0_p_10_and_later.ex
lib/kafka_ex/server_0_p_10_and_later.ex
@@ -125,8 +125,6 @@ defmodule KafkaEx.Server0P10AndLater do
_ -> raise "CreateTopic is not supported in this version of Kafka, or the versions supported by the client do not match the ones supported by the server."
end
- IO.puts "API version for create_topics: #{api_version}"
-
create_topics_request = %CreateTopics.Request{
create_topic_requests: requests,
timeout: network_timeout

Make api_versions compatible with Elixir 1.1