Skip to content

Commit

Permalink
In case of SASL we should pass consumer config to get topics list
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Smirnov committed Mar 22, 2024
1 parent bfe8893 commit 2bcdbf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kaffe/config/consumer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ defmodule Kaffe.Config.Consumer do
defp specify_wildcard_topics([], _), do: []

defp specify_wildcard_topics(topics, idx) do
metadata = :brod.get_metadata(endpoints(idx))
metadata = :brod.get_metadata(endpoints(idx), :all, client_consumer_config(idx))
topic_names = metadata |> elem(1) |> Map.get(:topics) |> Enum.map(& &1[:name])

Enum.flat_map(topics, fn("*" <> topic_name_tail) ->
Enum.filter(topic_names, &(String.ends_with?(&1, topic_name_tail)))
end) |> IO.inspect(label: "specify_wildcard_topics")
end)
end

def message_handler(idx), do: config_get!(idx, :message_handler)
Expand Down

0 comments on commit 2bcdbf4

Please sign in to comment.