Coder Social home page Coder Social logo

Comments (8)

zhongyusimon avatar zhongyusimon commented on May 3, 2024

Let me ask, did you check the configuration example in the README file? It shows you how to configure access limit per user.

About the restart, it's not really necessary, are you using spring-boot-actuator along with Spring Cloud Config Server? Applying these tools to your project will make it possible to change the configuration on the fly.

answered by @marcosbarbero

from spring-cloud-zuul-ratelimit.

zhongyusimon avatar zhongyusimon commented on May 3, 2024

I also have a doubt, that why dont we use code to dynamic change the filter params, so we can store the config in mysql or redis instead. and also can effect the config for a certain time interval. otherwise the refresh config is also a dangerous action, it may damage the online program.

from spring-cloud-zuul-ratelimit.

marcosbarbero avatar marcosbarbero commented on May 3, 2024

Hello @zhongyusimon, as this project is meant to use spring-cloud-netflix implementation in which supports spring-cloud-config-server, I don't believe it's good to add this jdbc configuration support as it's already supported by spring-cloud-config-server.

This project will always support the same configurations available for spring-boot.

from spring-cloud-zuul-ratelimit.

zhongyusimon avatar zhongyusimon commented on May 3, 2024

Then i have a suggestion about this. cause the project lack of custom logic, we could support config the rule of code style in addition. just like we can use most of models in config way or in code way, so that we can do a lot of things in code with persistence config or complex logic for routing.

from spring-cloud-zuul-ratelimit.

marcosbarbero avatar marcosbarbero commented on May 3, 2024

I'm not really sure if I understood your suggestion

from spring-cloud-zuul-ratelimit.

zhongyusimon avatar zhongyusimon commented on May 3, 2024

it means we can config the params in yaml or config it in code. just like we can use feign with packed function, or use RestTemplate with custom function.

from spring-cloud-zuul-ratelimit.

marcosbarbero avatar marcosbarbero commented on May 3, 2024

Feign and RestTemplate are totally different beasts comparing to this library.
Let's say that feign and restTemplate are libraries meant to be used directly and then you can reconfigure it as necessary because it needs to be explicitly used in the code in order to make the requests.

In the other hand, this rate limiter implementation is not meant to be explicitly used in the code, it needs to be configured and used as such, you won't explicitly call a filter or anything like that, however, if what you need is to be able to create your own filter then it will be necessary to revisit this project architecture, right now it's not that simple to make it.

from spring-cloud-zuul-ratelimit.

lchayoun avatar lchayoun commented on May 3, 2024

First, the configuration is on the refresh scope, so restart is not needed.

I strongly agree with @marcosbarbero, this project is an implementation specific to zuul in order to add rate limit capabilities with a minimum overhead and as fast as possible.
It is definitely not meant to be explicitly used in the business logic code.

But, if you want to customize the policies dynamically, you can always add a filter that runs before the rate limit filter and modify the policies configuration as you wish.
Of course, there are some limitation to the dynamicity of how this project use the configuration.

from spring-cloud-zuul-ratelimit.

Related Issues (20)

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.