Skip to content

Commit

Permalink
Validate number of specified brokers
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Schneppenheim committed Nov 15, 2021
1 parent 49300f0 commit 236d68c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func (c *Config) SetDefaults() {
}

func (c *Config) Validate() error {
if len(c.Brokers) == 0 {
return fmt.Errorf("no seed brokers specified, at least one must be configured")
}

err := c.TLS.Validate()
if err != nil {
return fmt.Errorf("failed to validate TLS config: %w", err)
Expand Down

0 comments on commit 236d68c

Please sign in to comment.