Skip to content

Rate limiting

Rate limits lets you reject interactions when they are used too often in a time span.

This uses Bucket4J, here's a quick breakdown:

  • A "bucket" contains how many requests are remaining
  • A bucket is composed of one or more "limits", if one is exhausted, the request is rejected
  • A limit describes how many requests are allowed (tokens), and define how fast, and in which way, the tokens are regenerated

For more details, check out the docs of Bucket4J

Next, look at how to declare rate limiters, or, declare them with annotations.