[1] pry(main)> d = Hermann::Discovery::Zookeeper.new('zk0.REDACTED.com:2181')
=> #<Hermann::Discovery::Zookeeper:0x57186526
@impl=
#<Hermann::Discovery::Zookeeper::CuratorImpl:0x391d1e33
@curator=
#<Java::OrgApacheCuratorFrameworkImps::CuratorFrameworkImpl:0x5287ba5f>>,
@zookeepers="zk0.REDACTED.com:2181">
[2] pry(main)> d.get_brokers
log4j:WARN No appenders could be found for logger (org.apache.curator.framework.imps.CuratorFrameworkImpl).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
=> ["kafka0.REDACTED.com:6667",
"kafka1.REDACTED.com:6667"]
[3] pry(main)>
[1] pry(main)> d = Hermann::Discovery::Zookeeper.new('zk0.REDACTED.com:2181')
=> #<Hermann::Discovery::Zookeeper:0x7b6141f0
@impl=
#<Hermann::Discovery::Zookeeper::ZkGemImpl:0x4fb64a52
@zookeepers="zk0.REDACTED.com:2181">,
@zookeepers="zk0.REDACTED.com:2181">
[2] pry(main)> d.get_brokers
log4j:WARN No appenders could be found for logger (org.apache.zookeeper.ZooKeeper).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
=> ["kafka0.REDACTED.com:6667",
"kafka1.REDACTED.com:6667"]
[3] pry(main)>
This change makes the loading of the 'zk' gem optional and implicit, as well as
the reliance on Curator being available in the JRuby runtime's classpath.
If neither Zookeeper client implementation are available, an exception will be
raised when attmepting to use Zookeeper-based discovery
Fixes#75
The primary issue with marshalling bytes back and forth previously was the use
of the StringEncoder class. By default the Kafka client library uses the
DefaultEncoder which is a no-op and simply allwos byte arrays through
This commit also moves tests back out of the platform specific scope and makes
the internal #push_single API more consistent to alllow easier testing.
Fixes#49
This commit also fixes a memory leak with the JRuby version of the gem where we
were not properly cleaning up children objects and holding onto references of
them forever
Fixes#46