peterprib / node-red-contrib-kafka-manager

Implement
GNU General Public License v3.0
22 stars 12 forks source link

Producer fails on v0.5.1 with error "Unknown" #74

Open asinino opened 6 months ago

asinino commented 6 months ago

When using key on the msg object the producer node fails with the error message "Unknown". This didn't happened on every installation I made of this node, so maybe it's is accepting some values as key.

I have digged for a while and found out that key value is also being used to set attribute property of the Kafka message, removing it from the line made it work again.

So the file is 'node-red-contrib-kafka-manager/kafkaManager/kafkaProducer.js' line 44, just need to replace:

attributes: msg.key || node.attributes || 0

by

attributes: msg.attributes || node.attributes || 0

and everything worked just fine.

Can you provide a fix for this? Maybe a v0.5.2.

I have tried the newer version v1.6.2 but it fails worse than this version, the message is created on the server without key and without value, I've not digged enough to figure out why.