/** @page mqtt_migration MQTT @brief How to migrate an MQTT application from v3 to 202009.00 and subsequent releases. The MQTT library has been refactored in 202009.00 and subsequent releases, to use only a single thread, and therefore no longer has any thread synchronization dependencies. New features such as persistent session support and QoS 2 publish delivery have also been added. The features of the MQTT libraries in v3 and 202009.00 and subsequent releases are defined by the common MQTT 3.1.1 spec; therefore, the two versions are similar. @section migration_mqtt_removed Removed features @brief The following features were present in v3, but removed in 202009.00 and subsequent releases: - Auto-reconnect
Version 3 has an auto-reconnect feature triggered through a call to `aws_iot_mqtt_yield`. In version 202009.00 and subsequent releases, the auto-reconnect feature has been removed.
Workaround: When a version 202009.00 and subsequent releases API call does not return @ref MQTTSuccess, the application should re-establish the underlying transport connection and then call @ref MQTT_Connect. We recommend that the application employ an exponential backoff strategy when re-establishing connections as explained in the [AWS blog for Exponential Back off and Jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/). - Thread support
Version 3 has an `_ENABLE_THREAD_SUPPORT_` macro for multi-threading use cases. Version 202009.00 and subsequent releases does not spawn any threads and therefore, the macro `_ENABLE_THREAD_SUPPORT_` has been removed. @section migration_mqtt_datatypes Data Types @brief The following table lists equivalent data types in v3 and 202009.00 and subsequent releases.
Version 3 Version 202009.00 and subsequent releases Notes
enum QoS @ref MQTTQoS_t MQTT Quality of service.
AWS_IoT_Client @ref MQTTContext_t MQTT connection handle.
IoT_Publish_Message_Params @ref MQTTPublishInfo_t Parameters of an MQTT publish.
IoT_MQTT_Will_Options @ref MQTTPublishInfo_t Optional Will parameter of an MQTT connect.
IoT_Client_Connect_Params @ref MQTTConnectInfo_t Parameters of an MQTT connect.
IoT_Client_Init_Params None The members of this struct in v3 handled setup of the network connection.
This is handled outside of the MQTT library in 202009.00 and subsequent releases.
pApplicationHandler_t @ref MQTTEventCallback_t Function pointer of application callback to receive incoming data.
@section migration_mqtt_functions Functions @brief The following table lists equivalent API functions in v3 and 202009.00 and subsequent releases. These functions are the API functions declared in: - In v3: aws_iot_mqtt_client_interface.h - In 202009.00 and subsequent releases: [MQTT functions](@ref mqtt_functions)
Version 3 Version 202009.00 and subsequent releases Notes
aws_iot_mqtt_init @ref MQTT_Init
aws_iot_mqtt_free None 202009.00 and subsequent releases does not allocate any memory and therefore, has nothing to free.
aws_iot_mqtt_connect @ref MQTT_Connect
aws_iot_mqtt_publish @ref MQTT_Publish
aws_iot_mqtt_subscribe @ref MQTT_Subscribe
aws_iot_mqtt_resubscribe None Function removed because auto-reconnect was removed.
aws_iot_mqtt_unsubscribe @ref MQTT_Unsubscribe
aws_iot_mqtt_disconnect @ref MQTT_Disconnect
aws_iot_mqtt_yield @ref MQTT_ProcessLoop @ref MQTT_ReceiveLoop is the equivalent function without any keep-alive mechanism.
aws_iot_mqtt_attempt_reconnect None Function removed because auto-reconnect was removed.
*/