Reputation: 1243
At one point when doing some testing with the Google DLP Java library, I got an exception that indicated that I had exceeded the API rate limit. Unfortunately I don't have the stack trace anymore, so I can't give any more detail at this point. However, it made me realize that I'm not handling that situation in the code. What is the recommended way of dealing with this from a Java application? I haven't seen any examples in the GitHub repo that gives any guidance on this. I'm aware of the ability to request quota increases, and I have already put in a request. My question is on how to gracefully handle this in the code, should I run into the quota exceeded situation again. Thanks.
Upvotes: 0
Views: 342
Reputation: 995
It depends greatly on your design and place in which you are making the call from.
If you never want to hit the error, you'll need to implement your own client side rate throttling with accompanying monitoring to assure that you know it's time to request more quota.
If you can retry and wait, try retrying using exponential backoff.
Upvotes: 1