Skip to content

Commit

Permalink
Merge pull request #903 from openmeterio/conf-broker-addr-family
Browse files Browse the repository at this point in the history
feat: mk broker.address.family configurable
  • Loading branch information
chrisgacsal authored May 14, 2024
2 parents 0883f29 + e8e8bc7 commit 0ac71c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type KafkaIngestConfiguration struct {
SaslPassword string
Partitions int
EventsTopicTemplate string
BrokerAddressFamily string
}

// CreateKafkaConfig creates a Kafka config map.
Expand All @@ -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"
}

Expand Down

0 comments on commit 0ac71c6

Please sign in to comment.