Skip to content
Ameen Abozaid
Planned lessonMID-034-L06

Demo: per-customer limits at the edge

  • Lesson 6 of 6
  • Mid-level
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

  1. Add a Redis-backed request rate limiter filter at the gateway (Spring Cloud Gateway offers one; verify version and key resolver before recording).
  2. Write a key resolver: authenticated customer id, falling back to IP.
  3. 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.
  4. Planned mistake: run two gateway instances with an in-memory limiter; the abuser gets double the allowance. Fix: shared Redis limiter.
  5. Add Retry-After and a clear JSON error body, and show a client script honoring it.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.