From fd27f864cc9d2f5094957417dbed4aa054e32307 Mon Sep 17 00:00:00 2001 From: Vladimir Yartsev Date: Sun, 21 Apr 2024 14:08:55 +0200 Subject: [PATCH 1/2] Support :extra_sock_opts --- lib/broadway_kafka/brod_client.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/broadway_kafka/brod_client.ex b/lib/broadway_kafka/brod_client.ex index c9633ca..f0d9be5 100644 --- a/lib/broadway_kafka/brod_client.ex +++ b/lib/broadway_kafka/brod_client.ex @@ -29,7 +29,8 @@ defmodule BroadwayKafka.BrodClient do :connect_timeout, :request_timeout, :client_id_prefix, - :query_api_versions + :query_api_versions, + :extra_sock_opts ] @default_receive_interval 2000 From 2bd8fc5d54b2fd7d13049e369fc6363716eb6c42 Mon Sep 17 00:00:00 2001 From: Vladimir Yartsev Date: Sun, 21 Apr 2024 15:22:25 +0200 Subject: [PATCH 2/2] Documentation --- lib/broadway_kafka/producer.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/broadway_kafka/producer.ex b/lib/broadway_kafka/producer.ex index a0cfda4..a2709bb 100644 --- a/lib/broadway_kafka/producer.ex +++ b/lib/broadway_kafka/producer.ex @@ -139,6 +139,9 @@ defmodule BroadwayKafka.Producer do * `:request_timeout` - Optional. Time in milliseconds to be used as a timeout for waiting response from Kafka. Default is to use `:brod`'s default timeout which is currently 240 seconds. + * `:extra_sock_opts` - Optional. `gen_tcp` socket options. [More info](https://www.erlang.org/doc/man/gen_tcp.html#type-option). + Set to `[:inet6]` if your Kafka broker uses IPv6. + > **Note**: Currently, Broadway does not support all options provided by `:brod`. If you have a scenario where you need any extra option that is not listed above, please open an issue, so we can consider adding it.