go-pubsub
go-pubsub copied to clipboard
Multiple topics subscription
Currently go-pubsub doesn't allow passing list of topics for single kafka consumer.
type MessageSourceConfig struct {
ConsumerGroup string
Topic string
Brokers []string
Offset int64
MetadataRefreshFrequency time.Duration
Version *sarama.KafkaVersion
}
It would be nice if this would be
type MessageSourceConfig struct {
ConsumerGroup string
Topic []string
Brokers []string
Offset int64
MetadataRefreshFrequency time.Duration
Version *sarama.KafkaVersion
}
Is this a relatively straightforward change as it looks since sarama cluster already takes a slice of strings for topics cluster.NewConsumer(mq.brokers, mq.consumergroup, []string{mq.topic}, config)
?
The questions that come to mind are:
- Can this be done in a way that doesn't compromise the goals of go-pubsub (making all brokers "look" the same)
- If so, is the gain worth the effort and potential added complexity?