MQTT.js
MQTT.js copied to clipboard
Two instances of client, the one who publish disconnect after every pub
Hi all! First of all, congratulations for the extraordinary work you do and keep doing. I have got a problem: I want to instantiate two clients that connect to two different brokers (the first gets the messages, the second ones publish the message after aggregations and manipulations). The problem is that the second one, every time it publishes a message, disconnects and reconnects.
These are the options I use to instantiate the two clients.
"options": {
"port": 18883,
"host": "tcp://192.168.3.77",
"username": "*******",
"password": "*******",
"clientId" : "gw__dev-************",
"protocolId": "MQIsdp",
"protocolVersion": 3
},
"thingOptions": {
"port": 8883,
"host": "mqtts://", //host url is built from other params
"username": "********",
"password": "***********",
"clientId" : "thing__dev-************",
"protocolId": "MQIsdp",
"protocolVersion": 3
}
What could be the mistake? Thanks for collaboration
Matteo