From 61bf8b7800d7e83c37b4710d45f36a123e7ee09d Mon Sep 17 00:00:00 2001 From: Juan Peri Date: Tue, 1 Mar 2022 19:14:14 +0100 Subject: [PATCH] pass SSL configurations when validating offset (#80) I'm also reverting the previous PR, where we removed the explicit pattern matching on the offset out of range --- lib/broadway_kafka/brod_client.ex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/broadway_kafka/brod_client.ex b/lib/broadway_kafka/brod_client.ex index 3a2eb72..cf4ea06 100644 --- a/lib/broadway_kafka/brod_client.ex +++ b/lib/broadway_kafka/brod_client.ex @@ -139,13 +139,11 @@ defmodule BroadwayKafka.BrodClient do if current_offset == :undefined do lookup_offset(config.hosts, topic, partition, policy, config.client_config) else - case :brod.fetch(config.hosts, topic, partition, current_offset) do + case :brod.fetch({config.hosts, config.client_config}, topic, partition, current_offset) do {:ok, _} -> current_offset - # We are looking for :offset_out_of_range but this may fail - # in earlier Kafka versions, so we perform a catch-all. - {:error, _} -> + {:error, :offset_out_of_range} -> lookup_offset(config.hosts, topic, partition, policy, config.client_config) end end