Coder Social home page Coder Social logo

Comments (7)

lchayoun avatar lchayoun commented on May 3, 2024

@loraclaa did you enable rate limit?

zuul:
  ratelimit:
    enabled: true 

from spring-cloud-zuul-ratelimit.

samuelweiwei avatar samuelweiwei commented on May 3, 2024

@lchayoun I did. What i want more is the further customization to my own business, and i need to overwrite -user and -url two parts in keygenerator.

from spring-cloud-zuul-ratelimit.

marcosbarbero avatar marcosbarbero commented on May 3, 2024

@loraclaa do you have a shareable project that reproduces the problem?

from spring-cloud-zuul-ratelimit.

samuelweiwei avatar samuelweiwei commented on May 3, 2024

@marcosbarbero It's a internal project which belongs to company, I can only paste parts of the codes.
I inject the @bean in the my application class like below:
@SpringBootApplication
@EnableZuulProxy
@EnableScheduling
@EnableCircuitBreaker
@EnableHystrixDashboard
public class ApiGatewayApplication{.....
@bean
public RateLimitKeyGenerator rateLimitKeyGenerator(final RateLimitProperties * properties) {
return new DefaultRateLimitKeyGenerator(properties) {...

Is it the right place or should it be injected in the defined filter?

Thanks.

from spring-cloud-zuul-ratelimit.

lchayoun avatar lchayoun commented on May 3, 2024

@loraclaa try to create the bean in a dedicated @Configuration class

from spring-cloud-zuul-ratelimit.

samuelweiwei avatar samuelweiwei commented on May 3, 2024

@lchayoun Thank you, it works, exception is finished with also @primary annotation. Or it will lead to some other exception with suggest "Consider marking one of the beans as @primary, updating the consumer to accept multiple beans, or using @qualifier to identify the bean that should be consumed".
I will check if my customization works.

from spring-cloud-zuul-ratelimit.

lchayoun avatar lchayoun commented on May 3, 2024

great 👍

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.