Some QOS 1 messages are lost when published during a disconnection #621
-
I am using an MQTT 5 client that publishes QoS 1 messages every 10 seconds. The client operates in an environment with an unreliable network, so disconnections are expected. I’ve observed that when a network disconnection occurs, not all messages are delivered to AWS IoT Core. Specifically, messages published around the disconnection time are often lost and never arrive at the broker. However, messages generated during the period of disconnection are successfully queued by the SDK and delivered once the connection is re-established. My client is configured with Has anyone else experienced this behavior? Is this a limitation or bug in the SDK, or is there something I might be missing in my configuration or usage? Any insights or suggestions would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
What values are you configuring for ack_timeout_sec and offline_queue_behavior? My guess is that the messages are sent, no ack is received due to disconnect and no ack timeout is set, causing them to be eternally pending. There could be an argument that there should always be a timeout by default. Such a change would alter existing behavior, but I'm not able to come up with a way that the change would worsen client behavior, and, at least in this case, it would significantly improve the default experience. |
Beta Was this translation helpful? Give feedback.
What values are you configuring for ack_timeout_sec and offline_queue_behavior?
My guess is that the messages are sent, no ack is received due to disconnect and no ack timeout is set, causing them to be eternally pending. There could be an argument that there should always be a timeout by default. Such a change would alter existing behavior, but I'm not able to come up with a way that the change would worsen client behavior, and, at least in this case, it would significantly improve the default experience.