|
@@ -6,7 +6,7 @@ import (
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
-var validID *regexp.Regexp = regexp.MustCompile(`\A[A-Za-z0-9._-]*\z`)
|
|
|
+var validID *regexp.Regexp = regexp.MustCompile(`\A[A-Za-z0-9._-]+\z`)
|
|
|
|
|
|
|
|
|
type Config struct {
|
|
@@ -258,6 +258,8 @@ func NewConfig() *Config {
|
|
|
|
|
|
c.ChannelBufferSize = 256
|
|
|
|
|
|
+ c.ClientID = DefaultClientID
|
|
|
+
|
|
|
return c
|
|
|
}
|
|
|
|
|
@@ -297,7 +299,7 @@ func (c *Config) Validate() error {
|
|
|
if c.Consumer.Offsets.Retention%time.Millisecond != 0 {
|
|
|
Logger.Println("Consumer.Offsets.Retention only supports millisecond precision; nanoseconds will be truncated.")
|
|
|
}
|
|
|
- if c.ClientID == "sarama" {
|
|
|
+ if c.ClientID == DefaultClientID {
|
|
|
Logger.Println("ClientID is the default of 'sarama', you should consider setting it to something application-specific.")
|
|
|
}
|
|
|
|