Skip to content

Commit

Permalink
update to new shutdown api
Browse files Browse the repository at this point in the history
Fixes #27.

Fixes #28
  • Loading branch information
talevy authored and jordansissel committed Sep 21, 2015
1 parent 52c58b4 commit 7e3bde1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/logstash/outputs/kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions spec/integration/outputs/kafka_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7e3bde1

Please sign in to comment.