Hi, I'm trying to extract the msg._session property from Msg.payload1 and combine it with a MQTT message (Msg.payload 2) to direct the MQTT messgae to the origin TCP port. I've found that using the MQTT node changes the message properties so i loose the "_session" id.
Basically im using legacy software that uses TCP/IP and i would like to "publish" the data send on the TCP port to my MQTT broker (Works a treat). This issue occurs when i have more than one port in use because without a "msg._session" property the reply on the TCP node is sent to all clients!
So i need to add the "msg._session" data from the TCP listening node and combine it with the MQTT node to direct the received data o the correct port.
[{"id":"711e43ea.656e5c","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"151e34e1.25016b","type":"debug","z":"711e43ea.656e5c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":970,"y":200,"wires":[]},{"id":"ac52cdac.04c0c","type":"inject","z":"711e43ea.656e5c","name":"Msg.payload 1","topic":"","payload":"{\"topic\":\"\",\"payload\":[47,63,48,48,49,33,13,10],\"ip\":\"::ffff:**.**.***.***\",\"port\":50584,\"_session\":{\"type\":\"tcp\",\"id\":\"10ba3c3c.801b74\"},\"_msgid\":\"d9b8325f.30c5e\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":300,"y":180,"wires":[["fd9418ad.dd1628"]]},{"id":"fd9418ad.dd1628","type":"change","z":"711e43ea.656e5c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload._session\t\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":180,"wires":[["c819d715.18bc38"]]},{"id":"278b7adf.cb5d76","type":"inject","z":"711e43ea.656e5c","name":"Msg.payload 2","topic":"","payload":"{\"topic\":\"Elster_A1700\",\"payload\":[6],\"qos\":0,\"retain\":false,\"_msgid\":\"52bd4fe6.ab172\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":240,"wires":[["c819d715.18bc38"]]},{"id":"c819d715.18bc38","type":"join","z":"711e43ea.656e5c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"/n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":830,"y":200,"wires":[["151e34e1.25016b"]]}]
I can extract the message using the change node and join it with the MQTT message, when i test it i keep getting "Cant merge non-object types"
Any help would be greatly appreciated!