-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kafka plugin refactor #375
Conversation
} | ||
|
||
func init() { | ||
plugins.Add("kafka", func() plugins.Plugin { | ||
plugins.Add("kafka_consumer", func() plugins.Plugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a breaking change, but this is what the plugin was supposed to be called in the 1st place. The original author only changed the directory name but not the plugin name.
I think it's OK to make this breaking change because this plugin was completely broken anyways 😷
Thanks @sparrc! |
@panda87 do you happen to know how to do that? I can't find any configuration options for specifying consume partitions, (see: https://godoc.org/github.com/wvanbergen/kafka/consumergroup#Config and https://godoc.org/github.com/Shopify/sarama#Config) |
@panda87 are you just asking for the consumer to have multiple goroutines reading the channel? https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example |
The answer is yes, but not from the Go channel but the kafka channel (topic). I can see 2 types which implement what I asked: |
Kafka are supporting consume topic from multiple threads. in Go it's called goroutines in others it's just another threads management methods. In regarding to the offset management, the ability to choose the offset to start consume with, is for the cases you want to start consume from offset 1 or continue from the latest offset number. Hope I explained myself better now. btw, thanks for adding this plugin to be able to consume from multiple topic in a single conf file. |
@panda87 From what I can tell, the consumergroup implementation is already doing this via zookeeper, see here: https://github.com/wvanbergen/kafka/blob/master/consumergroup/consumer_group.go#L276-L324 |
Yeah, it looks like it fetch the number of partitions, |
c84b42d
to
7c69dcb
Compare
@panda87 I think I can do the offset too. From what I understand, there are only two offset options, correct? |
Yes. Correct |
a3ed5e5
to
42f3961
Compare
@panda87 This is pretty much ready to go, let me know what you think, you can see that I've added facility for consuming multiple topics and setting the offset |
@sparrc this is look very good!! |
@panda87 currently there are no build artifacts being stored in CircleCI, I am going to work on getting nightly builds going for Telegraf soon |
@panda87, this is a work in progress, any feedback appreciated