Skip to content

Commit

Permalink
Always retrieve topic and broker metadata, to avoid spurious
Browse files Browse the repository at this point in the history
unknown topic errors on brokers.
  • Loading branch information
davidblewett committed Feb 6, 2024
1 parent 242f2f1 commit 0856d7c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions kafkaadmin/brokers.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ func (c Client) fetchBrokers(ctx context.Context) ([]kafka.BrokerMetadata, error
to = time.Until(dl)
}

// confluent-kafka-go loads both topic and broker metadata in a single call.
// This is a hack to avoid looking up topic metadata.
ts := ""
md, err := c.c.GetMetadata(&ts, false, int(to.Milliseconds()))
md, err := c.c.GetMetadata(nil, false, int(to.Milliseconds()))
if err != nil {
return nil, ErrorFetchingMetadata{err.Error()}
}
Expand Down

0 comments on commit 0856d7c

Please sign in to comment.