how to implement rate limiting functionality in spring boot embedded web servers

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.

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

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);
    }