Demo: per-customer limits at the edge
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
limit by customer and prove fairness. Prepares MID-034-LAB1.
Draft outline details
Step by step
- Add a Redis-backed request rate limiter filter at the gateway (Spring Cloud Gateway offers one; verify version and key resolver before recording).
- Write a key resolver: authenticated customer id, falling back to IP.
- Run a load test with an abusive client at 200 requests per second and a normal one at 5; show
429s only for the abusive one. - Planned mistake: run two gateway instances with an in-memory limiter; the abuser gets double the allowance. Fix: shared Redis limiter.
- Add
Retry-Afterand a clear JSON error body, and show a client script honoring it.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.