Skip to content

Reconnecting smoothly #116

@mbaroody

Description

@mbaroody

Hello,

First thanks for creating/maintaining this sdk. From the documentation, it states that you provide:

It provides basic synchronous MQTT operations in the classic MQTT publish-subscribe model, along with configurations of on-top features:
- Auto reconnect/resubscribe
- Progressive reconnect backoff
- Offline publish requests queueing with draining

However, I'm not experiencing these features. I expect when I call awsMQTTClient.publish(topic, message, qos) I expect not to ever get a publishTimeoutException(), except maybe when the maxReconnectQuietTimeSecond in configureAutoReconnectBackoffTime (docs) is exceeded. However, I get publishTimeoutException() quite often.

Do I have to do something like this now everytime I publish?

        try:
            myMQTTClient.publish("testing/IoT", message, 1)
        except:
            print(err)
            myMQTTClient.connect()
            myMQTTClient.publish("testing/IoT", message, 1)

What's the proper way of recovering from this type of timeout?

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions