iotagent-json
iotagent-json copied to clipboard
Analize: mosquitto restart loses mqtt agent topic subscriptions ?
A keepalive and a restart agent procedure would be a solution?
UL done by https://github.com/telefonicaid/iotagent-ul/blob/329cfebbe7dd6359ef13ca30075349603dfaba9a/lib/bindings/MQTTBinding.js#L134 JSON done by https://github.com/telefonicaid/iotagent-json/blob/dd6ebde6d4afe0f4c768af2937b5c48f2f73b3c4/lib/bindings/MQTTBinding.js#L134-L153
related https://github.com/telefonicaid/iotagent-json/pull/525
@AlvaroVega I'm investigating this issue.
In this case
ota-json time=2022-02-21T12:32:54.702Z | lvl=ERROR | corr=4b9c69b5-86eb-466d-956b-2cf1c776c170 | trans=4b9c69b5-86eb-466d-956b-2cf1c776c170 | op=IOTAJSON.MQTT.Binding | from=n/a | srv=XXXX | subsrv=/YYYY | msg=GLOBAL-001: Error subscribing to topics: Error: Connection closed
pro-core-smc-iota-json-6c7f4c7764-2cvrm smc-iota-json-container at /opt/iotagent-json/node_modules/mqtt/lib/client.js:105:29
pro-core-smc-iota-json-6c7f4c7764-2cvrm smc-iota-json-container at Array.forEach (
it seems that iotagent tries to reconnect but mosquitto refuse it. Maybe related with the usage of random mqtt client_id by iota, non a fixed one provided with IOTA_MQTT_CLIENT_ID