Closed jpodeszwik closed 9 years ago
I don't think this would be too difficult. I take it you are using a custom producer and not the logstash output.
Just return the whole iterated object here: https://github.com/joekiller/jruby-kafka/blob/master/lib/jruby-kafka/consumer.rb#L31
and then in the queue_event class we add an option to include the key metadata on the event and otherwise just process msg.message I think around here https://github.com/joekiller/jruby-kafka/blob/master/lib/jruby-kafka/consumer.rb#L31
@jpodeszwik I've implemented this on master. (https://github.com/joekiller/logstash-kafka/blob/master/lib/logstash/inputs/kafka.rb#L156). Take a look.
@joekiller Didn't have time to look deeper, but it seems fine. Thanx!
In my company we're using kafka keys to store some metadata like timestamp, etc. We need access to kafka keys in logstash.
I can add those changes myself and make pull requests, but first I need to have some kind of "green light".
Adding that will also require changes in jruby-kafka in Consumer class. We should put some kind of objects to queue instead of strings - that may not be backwards compatible. Should I add another option to juruby-kafka library and give client ability to choose if he wants to receive full objects or just string messages?