Skip to content

Commit

Permalink
feat: mk broker.address.family configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgacsal committed May 14, 2024
1 parent 0883f29 commit e8e8bc7
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 e8e8bc7

Please sign in to comment.