Skip to content

Instantly share code, notes, and snippets.

@jamescway
Created May 26, 2015 20:58
Show Gist options
  • Save jamescway/200e012c252588700807 to your computer and use it in GitHub Desktop.
Save jamescway/200e012c252588700807 to your computer and use it in GitHub Desktop.
# $bundle exec jruby hermann_test.rb
require 'hermann'
# require 'hermann/provider/java_simple_consumer'
require 'hermann/consumer'
require 'hermann_jars'
# zookeeper = "localhost:2181"
zookeeper = "localhost:2181"
groupId = "group1"
topic = 'topic1'
# example = Hermann::Provider::JavaSimpleConsumer.new(zookeeper, groupId, topic)
example = Hermann::Consumer.new(topic, groupId, zookeeper, {'zookeeper.connection.timeout.ms' => '4000', 'fetch.message.max.bytes'=> '25688608'})
example.consume do |msg|
puts "Recv: #{msg}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment