How to detect MQTT disconnections when using Shadow API

egoltzman wrote on February 19, 2019:

My device code is based on the Shadow Demo, that is, it is using Shadow API.
I need to identify connection lost and then to react on it.
I see in aws_api.c prvShadowMQTTCallback that if the MQTT event is eMQTTAgentDisconnect then the code resets the subscriptions to update\get\delete and return with no additional actions.
My questions here are:

  1. How can I know that there was a disconnection?
  2. Is there any mechanism that I can use to automatically try to resubscribe?

Gaurav-Aggarwal-AWS wrote on February 20, 2019:

Please see the response here:

Please let us know if you have any feedback about the new library. We are very interested in your feedback.