mirror of https://github.com/reiseburo/hermann
pass string to JavaProducer
This commit is contained in:
parent
c3f5744568
commit
132dbb94a9
|
@ -21,7 +21,7 @@ module Hermann
|
|||
@topic = topic
|
||||
@brokers = ThreadSafe::Array.new(brokers)
|
||||
if Hermann.jruby?
|
||||
@internal = Hermann::Provider::JavaProducer.new(brokers, opts)
|
||||
@internal = Hermann::Provider::JavaProducer.new(brokers.join(','), opts)
|
||||
else
|
||||
@internal = Hermann::Lib::Producer.new(brokers.join(','))
|
||||
end
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Hermann
|
||||
VERSION = '0.19.0'
|
||||
VERSION = '0.19.1'
|
||||
end
|
||||
|
|
|
@ -8,6 +8,21 @@ describe Hermann::Producer do
|
|||
let(:brokers) { ['localhost:1337'] }
|
||||
let(:opts) { { 'request.required.acks' => '1' } }
|
||||
|
||||
describe '#initialize' do
|
||||
context 'with C ruby', :platform => :mri do
|
||||
it 'joins broker array' do
|
||||
expect(Hermann::Lib::Producer).to receive(:new).with(brokers.first)
|
||||
expect(producer).to be_a Hermann::Producer
|
||||
end
|
||||
end
|
||||
context 'with Java', :platform => :java do
|
||||
it 'joins broker array' do
|
||||
expect(Hermann::Provider::JavaProducer).to receive(:new).with(brokers.first, opts)
|
||||
expect(producer).to be_a Hermann::Producer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#create_result' do
|
||||
subject { producer.create_result }
|
||||
|
||||
|
|
Loading…
Reference in New Issue