diff --git a/lib/logstash/outputs/kafka.rb b/lib/logstash/outputs/kafka.rb index 09ed0ad..b944a65 100644 --- a/lib/logstash/outputs/kafka.rb +++ b/lib/logstash/outputs/kafka.rb @@ -143,13 +143,12 @@ def register def receive(event) return unless output?(event) if event == LogStash::SHUTDOWN - finished return end @codec.encode(event) end - def teardown + def close @producer.close end end #class LogStash::Outputs::Kafka diff --git a/spec/integration/outputs/kafka_spec.rb b/spec/integration/outputs/kafka_spec.rb index 2d89902..02fd358 100644 --- a/spec/integration/outputs/kafka_spec.rb +++ b/spec/integration/outputs/kafka_spec.rb @@ -62,7 +62,7 @@ kafka = LogStash::Outputs::Kafka.new(config) kafka.register num_events.times do kafka.receive(event) end - kafka.teardown + kafka.close end it 'should have data integrity' do @@ -93,7 +93,7 @@ kafka = LogStash::Outputs::Kafka.new(config) kafka.register num_events.times do kafka.receive(event) end - kafka.teardown + kafka.close end it 'should send all events to one partition' do