0

I read that spring boot has embedded web servers.

But after going through spring docs on embedded servers and exploring tens of articles, I am not able to find documentation which can help me in developing rate limiting functionality using spring boot embedded web servers.

Looking at lack of resources, I am confused now. So putting my question here.

Is it possible to implement rate limiting functionality using spring boot embedded web servers. Any leads on this would be appreciated.

Onki
  • 1,879
  • 6
  • 38
  • 58
  • I think this answer will be useful for you. https://stackoverflow.com/questions/44042412/how-to-set-rate-limit-for-each-user-in-spring-boot – Ostap Kravtsiv Aug 04 '19 at 12:23

1 Answers1

0

I think there is no such funcionality out of the box. You can implement it by yourself, for example by using Filters:

public class LimitFilter extends GenericFilterBean {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        //do check if limit is reached
        chain.doFilter(request, response);
    }
Flip
  • 31
  • 11