Open PavelLoparev opened 1 year ago
I had this issue and discovered it was due to the value for number of messages being passed to the consume method being a string and not a number. It was being read from an external config file and parsed as a string resulting in the "Need to specify a callback" error being thrown. Looking at your example above though, I can't see how that would occur in this instance.
Environment Information
Steps to Reproduce I have a wrapper around
consumer.consume()
method like this:Then just call
await this.consumeEvents(100);
node-rdkafka Configuration Settings
Additional context I faced a weird issue that is reproducible only in the Docker container. Above I described a wrapper that I use for consuming events in
non-flowing mode
.Local env (described above):
await this.consumeEvents(100);
Docker env
await this.consumeEvents(100);
/node-rdkafka/lib/kafka-consumer.js:466:16:
I also found cpp code where this error is actually being thrown, I think it's here:
As far as I understand it validates 3rd parameter and for some reason, it's not a function but as we see from this code it's actually a passed callback function.
I also tried different combinations of node versions, node-rdkafka libs - nothing works in a Docker container.
Additionally, tried to build & run this code in a container on Intel-based Mac and on aws ec2 instance - the same result, just throws a described error.
Please help to investigate farther.