Skip to content

Commit

Permalink
Merge pull request #411 from kafkaex/release_0.11.0
Browse files Browse the repository at this point in the history
Release 0.11.0
  • Loading branch information
joshuawscott committed Jul 15, 2020
2 parents 750b6d6 + f8a4447 commit d0c3a6d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 33 deletions.
27 changes: 2 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"}
]
Expand All @@ -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)
Expand Down Expand Up @@ -458,8 +437,6 @@ mix test --include integration --include server_0_p_8_p_0

### Static analysis

This requires Elixir 1.5+.

```
mix dialyzer
```
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions test/integration/kayrock/timestamp_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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)
Expand Down

0 comments on commit d0c3a6d

Please sign in to comment.