A Spring Boot REST API must rate-limit requests per API key without external infrastructure. Which Spring component provides the most straightforward insertion point?
-
A
A @RestControllerAdvice that counts exceptions per key
-
B
A HandlerInterceptor or OncePerRequestFilter that checks a per-key counter before the controller executes
-
C
A @Transactional service method that queries a rate-limit table on every call
-
D
A Spring AOP @Around advice on all @RestController methods