Interface KeyResolver

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface KeyResolver
Extracts a partition key from an incoming request.

The resolved key identifies who the rate limit applies to — an IP address, an authenticated user ID, an API key, etc. Implementations are captured once at route registration time and called directly (no registry lookup) on every request.


 conf.registerResolver("ip",       req -> req.header("X-Forwarded-For"));
 conf.registerResolver("auth_user", req -> ClaimsHolder.user().sub());
 
  • Method Summary

    Modifier and Type
    Method
    Description