Tanishq Singh
Tanishq Singh

Reputation: 37

Serialise msg object coming from Kafka Producer and store in influxdb in Node-Red flow

I have the flow below in node-red, I need the msg object to be stored in influxdb - enter image description here

As you can see in the debug node coming out of the kafka consumer, the payload is being stored in Influxdb as [object Object] and not in a serialised manner with each column separated. If I store the msg object directly into influxdb(without the kafka producer and consumer in-between), then it's stored in db as required.

Is there a way to store the msg object in the influxdb properly with the kafka producer and consumer being part of the flow?

Upvotes: 0

Views: 356

Answers (1)

hardillb
hardillb

Reputation: 59668

As worked out in the comments, you need to include a JSON node before the Kafka Producer node because it expects a String as input not a JavaScript Object and the JSON node will Serialise the Object to a JSON string.

Upvotes: 1

Related Questions