0

I have a job in c# which runs every 5 minutes and acts like a heartbeat to check the client status

enter image description here

When the status is Disconnected_Retrying, I exit the timer job assuming built in retry logic will work. However, status always comes as Disconnected_Retrying and leads to unnecessary calls/request to server every 5 minute. Hence I am thinking of implementing exponential backoff method to overcome this issue

Started reading below GitHib code https://github.com/Azure/azure-iot-sdk-csharp/blob/main/iothub/device/src/RetryPolicies/ExponentialBackoff.cs

But I am not able to understand how to implement it.

kudlatiger
  • 3,028
  • 8
  • 48
  • 98
  • 1
    It's unclear to me where the 'client' runs. Is it in your timer function? Is it an IoT device? – Matthijs van der Veer Sep 15 '22 at 07:20
  • Retry on the function is in case of exception. Do you throw an exception when status is Disconnected_Retrying? Do you not want the function to trigger again in 5 min in case of Disconnected_Retrying? – Magnus Sep 15 '22 at 07:37
  • the client runs on an IoT device. I have updated the question. @MatthijsvanderVeer – kudlatiger Sep 15 '22 at 09:44
  • @Magnus Yes, currently it is trying every configured minutes/seconds, but I want to retry exponentially when status is Disconnected_Retrying. basically want to give time to server to respond. – kudlatiger Sep 15 '22 at 09:48

0 Answers0