2015-05-19 18:13:27 +00:00
|
|
|
require 'bundler/setup'
|
|
|
|
require 'hermann'
|
|
|
|
require 'hermann/discovery/metadata'
|
2015-06-11 22:28:41 +00:00
|
|
|
require 'hermann/consumer'
|
2015-05-19 18:13:27 +00:00
|
|
|
|
|
|
|
c = Hermann::Discovery::Metadata.new( "localhost:9092" )
|
2015-05-19 20:34:39 +00:00
|
|
|
c.topic("maxwell")
|
|
|
|
puts c.topic("maxwell").inspect
|
2015-05-19 18:13:27 +00:00
|
|
|
|
2015-06-11 22:28:41 +00:00
|
|
|
|
|
|
|
puts c.brokers.inspect
|
|
|
|
consumer = Hermann::Consumer.new("maxwell", brokers: "localhost:9092, localhost:9092", partition: c.topic('maxwell').partitions.first.id, offset: :start)
|
|
|
|
consumer.consume do |c|
|
|
|
|
puts c
|
|
|
|
end
|