nodefluent / node-sinek

:tophat: Most advanced high level Node.js Kafka client
MIT License
290 stars 52 forks source link

Error when passing empty array to NConsumer#adjustSubscription #84

Closed denic closed 5 years ago

denic commented 6 years ago

When passing an empty array (removing all subscriptions) to NConsumer#adjustSubscription() the following error occurs.

 Error: Local: Invalid argument or configuration
      at Function.createLibrdkafkaError [as create] (node_modules/node-rdkafka/lib/error.js:260:10)
      at KafkaConsumer.Client._errorWrap (node_modules/node-rdkafka/lib/client.js:470:29)
      at KafkaConsumer.subscribe (node_modules/node-rdkafka/lib/kafka-consumer.js:290:8)
      at NConsumer.adjustSubscription (node_modules/sinek/lib/librdkafka/NConsumer.js:669:19)

I worked around this by calling the unsubscribe() method of the underlying consumer - like adjustSubscription() does before setting the new subscription - in case the new topic list is emtpy.

Thanks and have a nice day!

krystianity commented 5 years ago

Fixed in 6.27.0