From d73d5f1af3416496851f363fd7f1bdba818c6512 Mon Sep 17 00:00:00 2001 From: Arnaud Marchand Date: Wed, 28 Nov 2018 19:39:52 +0100 Subject: [PATCH] Save point (#506) --- io/stomp/18-stomp.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/io/stomp/18-stomp.js b/io/stomp/18-stomp.js index 80652903..311f9e35 100644 --- a/io/stomp/18-stomp.js +++ b/io/stomp/18-stomp.js @@ -66,15 +66,15 @@ module.exports = function(RED) { node.client.connect(function(sessionId) { node.log('subscribing to: '+node.topic); node.client.subscribe(node.topic, function(body, headers) { + var newmsg={"headers":headers,"topic":node.topic} + try { - msg.payload = JSON.parse(body); + newmsg.payload = JSON.parse(body); } catch(e) { - msg.payload = body; + newmsg.payload = body; } - msg.headers = headers; - msg.topic = node.topic; - node.send(msg); + node.send(newmsg); }); }, function(error) { node.status({fill:"grey",shape:"dot",text:"error"});