Step 15 of 21
·
4 minutes
Go Easy on Your Partners
The Scenario
External APIs don't appreciate being hammered. PayPal blocks you after too many
concurrent requests. Stripe charges overage fees if you exceed per-minute limits.
And the government compliance API? You might just DDoS them...
We need to throttle our requests to stay within each provider's limits.
The Challenge
How do we throttle requests to stay within each provider's limits?
The Solution
Use
Rate Limiters — JobRunr Pro offers two types:
# Concurrent Rate Limiter — max simultaneous jobs
jobrunr.jobs.rate-limiter.concurrent-job-rate-limiter.PAYPAL=5
jobrunr.jobs.rate-limiter.concurrent-job-rate-limiter.REPORTING=3
# Sliding Time Window Rate Limiter — max jobs per time window
jobrunr.jobs.rate-limiter.sliding-time-window-rate-limiter.STRIPE=10/PT1M
PayPal: max 5 concurrent. Stripe: max 10 per minute. Government: max 3 concurrent.
No more angry API providers or surprise bills!
Read the documentation →
Try It Yourself
Create bulk payments across all platforms. Watch the dashboard — PayPal and
government jobs process 5 and 3 at a time, while Stripe jobs spread evenly
across each minute.
You need to log in to perform write operations. You can still view the code solution and dashboard.