node-rdkafka icon indicating copy to clipboard operation
node-rdkafka copied to clipboard

consumer: fix consumeNum to respect consume timeout

Open katreniak opened this issue 2 years ago • 0 comments

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.

katreniak avatar Nov 07 '23 08:11 katreniak