Skip to content

Commit 236d68c

Browse files
author
Martin Schneppenheim
committed
Validate number of specified brokers
1 parent 49300f0 commit 236d68c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kafka/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ func (c *Config) SetDefaults() {
2020
}
2121

2222
func (c *Config) Validate() error {
23+
if len(c.Brokers) == 0 {
24+
return fmt.Errorf("no seed brokers specified, at least one must be configured")
25+
}
26+
2327
err := c.TLS.Validate()
2428
if err != nil {
2529
return fmt.Errorf("failed to validate TLS config: %w", err)

0 commit comments

Comments
 (0)