Rate limiting requests to Amazon AWS services #2340
-
I've found many examples of using Polly with The service I'm using (SES) limits requests to 50,000 per day and 14 per second. I'd like to run as many requests in parallel as possible, without exceeding the limit, and without queuing (if I hit the limit, there should be backpressure rather than queuing, which is computationally expensive). Are there any simple samples of using Polly with AWS, Azure, etc.? If not, and I must start from scratch, am I right in assuming that I should investigate the "Rate Limiting Policy"? Does it handle the above use case alone, or should it be paired with something else? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Can you share a link to a specific There are some Apart from the above, Our documentation for rate-limiting should be applicable for AWS, Azure or anything else. If you want to go down the HttpClient-specific route, you would need to tie the creation of AWS clients into the HttpClient pipeline so that instances are retrieved from HttpClientFactory, rather than through its own-built-in mechanism. For example you could create a custom implementation of |
Beta Was this translation helpful? Give feedback.
Can you share a link to a specific
HttpClient
example you're looking at?There are some
HttpClient
-specific ways to integrate Polly that "hide" it from the consumer by hooking into HttpClientFactory and adding Polly into the HTTP request pipeline transparently. The Microsoft extensions for Polly use this approach, for example.Apart from the above,
HttpClient
isn't special and any code can be wrapped with Polly to do retries, circuit-breaking, rate-limiting, timeouts etc.Our documentation for rate-limiting should be applicable for AWS, Azure or anything else.
If you want to go down the HttpClient-specific route, you would need to tie the creation of AWS clients into the HttpClient pipeli…