producer: Outstanding events even if message if flushed
Closed this issue · 0 comments
agis commented
The following script produces exactly 1 message:
# test.rb
require 'rafka'
p = Rafka::Producer.new
p.produce("test-rafka2", "foo#{Time.now}")
We run it as follows:
$ ruby test.rb
Since producing is an asynchronous operation, the script exits immediately. In the meanwhile, a consumer is running on the topic and consumes the message, but Rafka reports the following:
# ...
[producer-13] 2017/08/24 13:06:52 Started working...
# ... script has exited by now
# ... 5 secs. pass
[producer-13] 2017/08/24 13:06:57 Flush timeout: 1 unflushed events
[producer-13] 2017/08/24 13:06:57 Bye
This is a bug: there shouldn't be any outstanding events in the queue since the message was actually processed by the consumer.