consumer: bugfix direct consuming of specific partitions
When moving all consumer options to NewClient, I accidentally forgot to
allow the consumer to start if _only_ partitions are specified. This
fixes that.
The config validate() function disallows improper topic/group/partitions
combindations, so this is the only part that needed touched up.
Tested on kcl.
@@ -132,7 +132,7 @@ func (c *consumer) init(cl *Client) {
c.cl = cl
c.sourcesReadyCond = sync.NewCond(&c.sourcesReadyMu)
- if len(cl.cfg.topics) == 0 {
+ if len(cl.cfg.topics) == 0 && len(cl.cfg.partitions) == 0 {
return // not consuming
}
