go-pubsub icon indicating copy to clipboard operation
go-pubsub copied to clipboard

Multiple topics subscription

Open Gobonoid opened this issue 6 years ago • 2 comments

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
}

Gobonoid avatar Jul 05 '18 14:07 Gobonoid

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) ?

aneshas avatar Feb 09 '19 17:02 aneshas

The questions that come to mind are:

  1. Can this be done in a way that doesn't compromise the goals of go-pubsub (making all brokers "look" the same)
  2. If so, is the gain worth the effort and potential added complexity?

mjgarton avatar Feb 10 '19 10:02 mjgarton