Skip to main content

Rate Limit Retry Headers in the C# NuGet SDK?

DarenPorter-1148
Original Poster

My team is working on updating our integration to account for the upcoming rate limits, and we're wondering if there's any way to get access to the X-Retry header values to better respond to rate limit timing without simply retrying until it succeeds. Noting this section in the "Working with Rate Limits" guide:

 

"If using the .NET Geotab.Checkmate.Objectmodel nuget package, there is no access to the headers of the request. To facilitate testing of how your integration works with the new limits, a new optional parameter has been added to the API.cs constructor. Constructing with the optional ApiClientConfiguration with EnableRateLimitObservation set to true and run your integration The nuget package will throw an OverLimitException from the library when the returned result is over a given limit even though the server is not limiting the request."

 

This makes it seem like it's only the NuGet SDK that does not expose this information. Of course it would be extremely useful - without it, my options are to have something like an exponential backoff retry policy and keep retrying until the next successful request, or to always wait for the full period, even if it would end sooner. If I know how long I have to wait, I can avoid making further calls that I would otherwise know will fail, and only wait exactly as long as I need to before trying again.

 

I had hoped OverLimitException might expose that information through custom properties, but from what I can tell, it's only a thin wrapper around Exception that allows it to have a more descriptive Type name.

 

Is there any way to know how long to wait until retrying using the NuGet SDK?

Join the conversation

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

Top Answers

Hi @DarenPorter-1148​ !

 

My apologies for the delayed reply - just returned from Maternity Leave and there is so much to catch up on.

 

Let me reach out to our SDK experts to see how long you need to wait until retrying using the NuGet SDK.

 

In the meantime I wanted to share that there is an existing development ticket to expose over-limit information, contained on the headers X-Rate-Limit, on C# SDK. However, it does not have any expected start or finish date. Sharing your need for this in the Feedback Hub might be able to help build a business case around why our Product team should prioritize this.

 

I'll follow up as soon as I hear back from the team.

 

Warm Regards,

Gen

6 Replies

DarenPorter-1148
Original Poster

Does anyone know if there's an answer to this? If not I'll make a feature request, but I wanted to poke around and see if there was something I'm missing before doing that.

Hi @DarenPorter-1148​ !

 

My apologies for the delayed reply - just returned from Maternity Leave and there is so much to catch up on.

 

Let me reach out to our SDK experts to see how long you need to wait until retrying using the NuGet SDK.

 

In the meantime I wanted to share that there is an existing development ticket to expose over-limit information, contained on the headers X-Rate-Limit, on C# SDK. However, it does not have any expected start or finish date. Sharing your need for this in the Feedback Hub might be able to help build a business case around why our Product team should prioritize this.

 

I'll follow up as soon as I hear back from the team.

 

Warm Regards,

Gen

DarenPorter-1148
Original Poster

No problem at all @Genevieve-1051​, I appreciate the follow up. More importantly, congratulations!

 

No need to reach out to the SDK team, your last point is the answer that I was looking for. It seems it's not supported, but on the SDK team's backlog to accomplish, and hasn't been prioritized yet.

 

I'll gladly make my case for the feature in the Feedback Hub. We're working hard to update our integrations to conform to the new limits, and knowing exactly how long we have to wait when we hit one would allow us to stay as performant as possible.

 

Thanks again!

Thank you @DarenPorter-1148​ !

 

Happy to help anytime!

 

Both members of the Community Team have actually been out due to new babies so I appreciate the patience and understanding. I'm back now and Eishi will be back next week, so we should be back to normal very soon.

DarenPorter-1148
Original Poster

Thanks again @Genevieve-1051​ !

 

Just wanted to note, I've created a new post in the feedback hub requesting this feature:

https://community.geotab.com/s/feedback/a40Pd00000156nNIAQ/provide-xretry-header-data-in-c-nuget-sdk?language=en_US

 

I mentioned in that post already, but just in case it's helpful I will say here as well - given that rate limits will be in place at the end of next month, and that the requested data is already made available to the NuGet SDK (it can already "fake" limits by inspecting those header values internally), I'd like to make a case for giving the feature higher priority.

Perfect @DarenPorter-1148​ !

 

It's always beneficial to include it on any relevant posts to guarantee anyone else who lands on this question can add to the submission. Thanks for your help!

Still have questions?