lcarli / NodeRedIoTHub

Fork from origin plus changes
Apache License 2.0
14 stars 24 forks source link

Handling of errors on message publishing #18

Open vitaliyonoshko opened 6 years ago

vitaliyonoshko commented 6 years ago

Hello Gentlemen,

Fisrt of all, thank you for creating Azure IoT Hub nodes. I've been using the package for a while, it is awesome!

Recently I've faced the situation when handling of messages publish fails is required. As a simple exmaple, the scenarion would look like the following:

  1. Get/generate some data within nodes;
  2. Wrap the data into IoT Hub Publish Node package;
  3. Publish the message;
  4. Check if message was sent;
  5. If any error on publishing occur - save message within flow;
  6. Try to send message later, repeat until message will be sent successfully.

First three steps (publishing without sending success checking) are working perfectly on local PC as well as Raspberry Pi, however in case if for some reason the message is not sent (i.e. no Internet connection or bad credentials etc.) - Node-RED server instance crashes. Implementation of "Catch Node" for "Publish Node" does not help.

Could you please suggest a solution for publish error handling which would sustain Node-RED server operations?

Thank you in advance!

Best Regards, Vitaliy