diff --git a/config/ingest.go b/config/ingest.go index 3cff76156..ec04f43c6 100644 --- a/config/ingest.go +++ b/config/ingest.go @@ -30,6 +30,7 @@ type KafkaIngestConfiguration struct { SaslPassword string Partitions int EventsTopicTemplate string + BrokerAddressFamily string } // CreateKafkaConfig creates a Kafka config map. @@ -44,7 +45,9 @@ func (c KafkaIngestConfiguration) CreateKafkaConfig() kafka.ConfigMap { // This is needed when using localhost brokers on OSX, // since the OSX resolver will return the IPv6 addresses first. // See: https://github.com/openmeterio/openmeter/issues/321 - if strings.Contains(c.Broker, "localhost") || strings.Contains(c.Broker, "127.0.0.1") { + if c.BrokerAddressFamily != "" { + config["broker.address.family"] = c.BrokerAddressFamily + } else if strings.Contains(c.Broker, "localhost") || strings.Contains(c.Broker, "127.0.0.1") { config["broker.address.family"] = "v4" }