Connection interrupted with error AWS_ERROR_MQTT_UNEXPECTED_HANGUP after inactive period #736
-
I have an IoT application that publishes some data to a single MQTT periodically. If the frequency is short enough, everything works as expected, data is published, it's received by the server, and all is well. However, I've noticed that if I wait long enough, the next time I try to publish, then the call to
A short time later, I see the connection resume with an error code of
This continues, but the resume / interrupt sequence happens more infrequent as time goes on. Once this happens once, I'm never able to publish again. I'm not sure exactly how long I have to wait before publishing to get this error, but everything succeeds at 700 seconds or less and fails at 800 seconds or more. I have found some articles suggesting that I also added the following to the client build config, but this didn't help either.
Here are the parameters to the connect function that I'm using:
Any suggestions for how to debug? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Well, it seems the underlying problem was sending a message that was too large. I'm assuming that the constant reconnect + interrupt was the publish method retrying to send. When retrying, it reconnected immediately, but because the payload is too large, it caused an interruption again. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Well, it seems the underlying problem was sending a message that was too large. I'm assuming that the constant reconnect + interrupt was the publish method retrying to send. When retrying, it reconnected immediately, but because the payload is too large, it caused an interruption again.