What is the best way to identify throttling #2051
Replies: 2 comments 1 reply
-
Hi Tom - For context, are we talking about device or service SDK? Hub? Which transport protocol are you using? Thanks, |
Beta Was this translation helpful? Give feedback.
-
There are many ways to look at throttling. The most straight-forward one is maximum number of operations per unit of time. Hub defines many additional throttling conditions and limits, so I'll try to include as many of them as possible. You can read more about all hub quotas and throttling. In all cases, the IsTransient property can be checked if the client should attempt retry, or not. Service clientFor the service SDK, there are several clients: When you are being throttled in a data-plane SDK, it comes back as an error on the response and is surfaced to the SDK user as an exception. Some of these errors are documented by the service and here is one example for ThrottlingException with an HTTP response code of 429 with a sub code of 001.
Device clientFor a device SDK, depending on which protocol is used, it may simply be disconnected, or may get an exception. The device client has built-in retry policy, and if left to the default, it will retry indefinitely. However, if the retry policy is overridden, it may be necessary to handle exceptions from throttling. Many of the same exceptions apply on the device. You can see the list here. We have a good code sample that describes how to author a device/module app. Please take a look at that to understand how to handle connection events. Does this help? |
Beta Was this translation helpful? Give feedback.
-
What is the best way to identify throttling other than checking for the exceptions? Are there response headers, or other ways to keep track of that?
For example, we have an assumption that we are throttled on the IP level and want to see how we can identify this.
Beta Was this translation helpful? Give feedback.
All reactions