We have an IoT based application device which is configured to communication with our Dashboard via MQTT bridge from Various service providers like Google, AWS and Azure.
So the flow is:
- Device start TLS session with service provider.
- Subscribe to a particular topic and wait for messages from the service provider with 5 second timeout.
- Dashboard publishes messages to same topic periodically.
- IoT service provider broadcast it to all devices subscribed.
Publish and subscribe messages are with MQTT QOS 1 services.
Observation:
AWS and Azure works fine with above flow, but device stop receiving messages from Google MQTT bridge after 3-5 successful iterations even though our dashboard is publishing messages to Google IoT MQTT bridge.
For Google, we have identified that control flow is different when compared with Azure and AWS.
For Google, we need to subscribe and un-subscribe for a given topic every-time before waiting to receive message while for AWS and Azure we need to subscribe once during opening a MQTT connection.
Issue:
Sometime 5 sec device timeout occurs as it could not receive messages for subscribed topic from Google MQTT bridge. Adding multiple retries to overcome timeout issue was unsuccessful as issue still persist as device could not receive message from Google MQTT bridge after 45-60sec of device operation after powering on.
- Is there is constraint with Google MQTT bridge to receive messages periodically without subscribing it every-time?
- How can device receive messages without timing out (5 sec) from Google MQTT bridge?
- Is there any workaround to recover a device once it got timed out with establishing MQTT reconnection?