Skip to content

Commit

Permalink
[autothrottle] only init KafkaAdmin if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiealquiza committed Apr 25, 2022
1 parent 015351a commit 0105db0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/autothrottle/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@ func main() {
failureThreshold: Config.FailureThreshold,
}

if err := ThrottleManager.InitKafkaAdmin(Config.BootstrapServers); err != nil {
log.Fatal(err)
// Init a KafkaAdmin Client if needed.
if Config.KafkaNativeMode {
if err := ThrottleManager.InitKafkaAdmin(Config.BootstrapServers); err != nil {
log.Fatal(err)
}
log.Printf("Connected to Kafka: %s\n", Config.BootstrapServers)
}

// Run.
Expand Down

0 comments on commit 0105db0

Please sign in to comment.