node-rdkafka
node-rdkafka copied to clipboard
consumer: fix consumeNum to respect consume timeout
Steps to reproduce the problem:
- configure consumer with
setDefaultConsumeTimeout(1000) - produce 1 message every 500ms
- call
consumer.consume(128, cb)
Actual outcome:
- consume returns batch of 128 messages after 64 seconds
Expected outcome:
- consumer returns batch of ~2 messages after 1 second
KafkaConsumerConsumeNum call underlaying c++ m_consumer->Consume
in cycle until
- either the accumulated batch is full
- or the call to c++ m_consumer->Consume times out on the total timeout
KafkaConsumerConsumeNum must enforce its timeout
over all m_consumer->Consume invocations altogether.