Giter Club home page Giter Club logo

rate-limit-module's Introduction

rate-limit-module

This module limits api call from requestor using configuration properties. Requestors are identified by ip addresses.

Prerequisites

  • JDK 1.8 or later
  • Gradle 4+
  • You can also import the code straight into your IDE: IntelliJ IDEA

Configure

  • Go to spring-boot-rate-limit-module\spring-boot-rate-limit\src\main\resources\application properties
  • Specify rate limit. Default is 100
  • Specify time limit. Default is 1 hour

Installing

run the application using gradlew bootRun.

gradlew bootRun. 

Now that the service is up, visit http://localhost:8080/welcome, where you see: Welcome!

Running Integration tests

Run gradlew tests

gradlew tests

Running manual tests on local

  • Start using gradlew bootRun
  • Visit api endpoint http://localhost:8080/welcome
  • Send request more than configured rate limit i.e if rate limit is 3 call send request >4 time to see rate limit exceed message

Limitations and improvements:

  • Only In-Memory version of rate limiter has been implemented though design is flexible to implement thirdparty enabled cache also.

rate-limit-module's People

Contributors

tabassumsarah avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.