diff --git a/README.md b/README.md index c07ca018..ed118ea0 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ TL;DR: * Version 1.0 of KafkaEx will be based on Kayrock and have a cleaner API - you can start testing this API by using modules from the `KafkaEx.New` namespace. See below for details. +* Version 0.11.0+ of KafkaEx is required to use Kayrock. To support some oft-requested features (offset storage in Kafka, message timestamps), we have integrated KafkaEx with @@ -105,7 +106,7 @@ defmodule MyApp.Mixfile do defp deps do [ # add to your existing deps - {:kafka_ex, "~> 0.10"}, + {:kafka_ex, "~> 0.11"}, # if using snappy compression {:snappy, git: "https://github.com/fdmanana/snappy-erlang-nif"} ] @@ -115,28 +116,6 @@ end Then run `mix deps.get` to fetch dependencies. -### Adding the kafka_ex application - -When using elixir < 1.4, you will need to add kafka_ex to the applications list of your mix.exs file. - -```elixir -# mix.exs -defmodule MyApp.Mixfile do - # ... - - def application do - [ - mod: {MyApp, []}, - applications: [ - # add to existing apps - :logger, etc.. - :kafka_ex, - :snappy # if using snappy compression - ] - ] - end -end -``` - ## Configuration See [config/config.exs](https://github.com/kafkaex/kafka_ex/blob/master/config/config.exs) @@ -458,8 +437,6 @@ mix test --include integration --include server_0_p_8_p_0 ### Static analysis -This requires Elixir 1.5+. - ``` mix dialyzer ``` diff --git a/mix.exs b/mix.exs index 1717c32e..6dc56223 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule KafkaEx.Mixfile do def project do [ app: :kafka_ex, - version: "0.10.0", + version: "0.11.0", elixir: "~> 1.5", dialyzer: [ plt_add_deps: :transitive, diff --git a/test/integration/kayrock/timestamp_test.exs b/test/integration/kayrock/timestamp_test.exs index 0563d115..0c66448e 100644 --- a/test/integration/kayrock/timestamp_test.exs +++ b/test/integration/kayrock/timestamp_test.exs @@ -111,7 +111,7 @@ defmodule KafkaEx.KayrockTimestampTest do test "log with append time - v0", %{client: client} do topic = "test_log_append_timestamp_#{:rand.uniform(2_000_000)}" - {:ok, topic} = + {:ok, ^topic} = TestHelper.ensure_append_timestamp_topic( client, topic @@ -148,7 +148,7 @@ defmodule KafkaEx.KayrockTimestampTest do test "log with append time - v3", %{client: client} do topic = "test_log_append_timestamp_#{:rand.uniform(2_000_000)}" - {:ok, topic} = + {:ok, ^topic} = TestHelper.ensure_append_timestamp_topic( client, topic @@ -186,7 +186,7 @@ defmodule KafkaEx.KayrockTimestampTest do test "log with append time - v5", %{client: client} do topic = "test_log_append_timestamp_#{:rand.uniform(2_000_000)}" - {:ok, topic} = + {:ok, ^topic} = TestHelper.ensure_append_timestamp_topic( client, topic diff --git a/test/test_helper.exs b/test/test_helper.exs index 3b54e08b..ee2ee16d 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -116,7 +116,7 @@ defmodule TestHelper do topic_errors: [%{error_code: error_code}] }} = resp - wait_for_topic_to_appear(client, topic_name) + wait_for_topic_to_appear(client, topic_name) if error_code in [0, 36] do {:ok, topic_name} @@ -128,15 +128,20 @@ defmodule TestHelper do defp wait_for_topic_to_appear(_client, _topic_name, attempts \\ 10) - defp wait_for_topic_to_appear(_client, _topic_name, attempts) when attempts <= 0 do + defp wait_for_topic_to_appear(_client, _topic_name, attempts) + when attempts <= 0 do raise "Timeout while waiting for topic to appear" end defp wait_for_topic_to_appear(client, topic_name, attempts) do {:ok, %{topic_metadata: topic_metadata}} = - Client.send_request(client, %Kayrock.Metadata.V0.Request{}, NodeSelector.controller()) + Client.send_request( + client, + %Kayrock.Metadata.V0.Request{}, + NodeSelector.topic_partition(topic_name, 0) + ) - topics = topic_metadata |> Enum.map(&(&1.topic)) + topics = topic_metadata |> Enum.map(& &1.topic) unless topic_name in topics do wait_for_topic_to_appear(client, topic_name, attempts - 1)