Azure IoT SDKs for Node.js v1.2.1 (Device) and v1.2.0 (Service)
Bugfixes:
- #73 with #131 (MQTT Premature close error)
- #119 with #120 (typescript types in service SDK - thanks @nebrius !)
- Removed dependency to old sinon.js version that was producing deprecation warnings
- Removed deprecated
--type-check
option in the tslint npm script.
New features:
- #127 Retry logic for the AMQP Client of the service SDK (to retry connecting and sending C2D messages)
Retries in azure-iothub.Client
Before this release, the SDK user had to manually manage if the Client was connected or not before sending C2D messages and eventually called connect.
if not connected. it was also mandatory to listen to the disconnect
event.
With the new AMQP state machine and Client introduced in this release, sending C2D messages automatically handles connecting the client if necessary, and retries connecting and sending messages (if the error can be retried, such as a timeout). this is done using the azure-iot-common.ExponentialBackoffWithJitter
policy. it is possible to modify the retry policy using the Client.setRetryPolicy
API.
Please note: the current retry logic does not include the FeedbackReceiver
and FileNotificationReceiver
objects: this is in our backlog but if you are using those for now, you should still listen to the disconnect
event and call getFeedbackReceiver
and getFileNotificationReceiver
manually to re-establish the link. Calling any of these APIs will also automatically connect the client.