Skip to content

Commit

Permalink
Validate number of specified brokers
Browse files Browse the repository at this point in the history
Martin Schneppenheim committed Nov 15, 2021

Verified

This commit was signed with the committer’s verified signature.
sagikazarmark Márk Sági-Kazár
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
@@ -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)

0 comments on commit 236d68c

Please sign in to comment.