Azure / azure-iot-sdk-node

A Node.js SDK for connecting devices to Microsoft Azure IoT services
https://docs.microsoft.com/en-us/azure/iot-hub/
Other
262 stars 227 forks source link

[Technical Question] Is it possible to change QoS when using sendEvent with MQTT protocol? #1154

Closed AshWhitear closed 1 year ago

AshWhitear commented 1 year ago

We're currently managing a persistent queue of message to go out to the Azure IotHub, the issue is we are in a poorly connected environment, prone to sporadic network and power outages so any queueing within the MQTT library isn't sufficient.

It looks like the library has the QoS property hard coded for publish events within MQTT, is there a recommended path to override this while using the rest of the SDK features?

Thanks, Ash.

AshWhitear commented 1 year ago

Have also noticed the documentation seems to suggest I could adjust this, but havent found any way to just yet.

image

Thanks, Ash.

AshWhitear commented 1 year ago

For anyone in a similar situation, I couldnt find a great way to get the behaviour I required using the MQTT protocol and given time constraints ultimately opted for the HTTP protocol lib which not only appears to fail quickly following a network outage, but also does not appear to retain a queue within the SDK once the callback has been fired.

Please note this approach is more limited, and does not support onDeviceMethods.

Thanks, Ash.