I tried to implement rate limiting in spring boot with spring cloud netflix rate limiter
See original GitHub issueThese are the dependencies that I added
Spring boot: 1.5.4
compile('org.springframework.cloud:spring-cloud-starter-netflix-zuul')
compile group: 'com.marcosbarbero.cloud', name: 'spring-cloud-zuul-ratelimit', version: '1.7.5.RELEASE'
properties
zuul.ratelimit.enabled=true
zuul.ratelimit.repository=JPA
zuul.ratelimit.policy-list.serviceSimple.limit=1
zuul.ratelimit.policy-list.serviceSimple.refresh-interval=60
zuul.ratelimit.policy-list.serviceSimple.type=url
zuul.ratelimit.key-prefix=rate
zuul.strip-prefix: true
When I try to run the application an error shows that my domain classes aren’t a managed type
caused by: java.lang.IllegalArgumentException: Not a managed type: <My entity class>
at org.hibernate.jpa.internal.metamodel.MetamodelImpl.managedType(MetamodelImpl.java:210) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.<init>(JpaMetamodelEntityInformation.java:70) ~[spring-data-jpa-1.11.9.RELEASE.jar:na]
at org.springframework.data.jpa.repository.support.JpaEntityInformationSupport.getEntityInformation(JpaEntityInformationSupport.java:68) ~[spring-data-jpa-1.11.9.RELEASE.jar:na]
at org.springframework.data.jpa.repository.support.JpaRepositoryFactory.getEntityInformation(JpaRepositoryFactory.java:173) ~[spring-data-jpa-1.11.9.RELEASE.jar:na]
at org.springframework.data.envers.repository.support.EnversRevisionRepositoryFactoryBean$RevisionRepositoryFactory.getTargetRepository(EnversRevisionRepositoryFactoryBean.java:106) ~[spring-data-envers-1.1.9.RELEASE.jar:na]
at org.springframework.data.envers.repository.support.EnversRevisionRepositoryFactoryBean$RevisionRepositoryFactory.getTargetRepository(EnversRevisionRepositoryFactoryBean.java:77) ~[spring-data-envers-1.1.9.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:200) ~[spring-data-commons-1.13.9.RELEASE.jar:na]
at org.springframework.data.envers.repository.support.EnversRevisionRepositoryFactoryBean$RevisionRepositoryFactory.getRepository(EnversRevisionRepositoryFactoryBean.java:143) ~[spring-data-envers-1.1.9.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:277) ~[spring-data-commons-1.13.9.RELEASE.jar:na]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:263) ~[spring-data-commons-1.13.9.RELEASE.jar:na]
at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:101) ~[spring-data-jpa-1.11.9.RELEASE.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
... 42 common frames omitted
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (6 by maintainers)
Top Results From Across the Web
Rate Limiting in Spring Cloud Netflix Zuul - Baeldung
Learn how to rate limit requests using Spring Cloud Zuul. ... It adds some specific features for Spring Boot applications.
Read more >API Rate Limiting with Spring Cloud Gateway
Rate limiting is a technique to control the rate by which an API ... spring.cloud.gateway.filter.request-rate-limiter.deny-empty-key=false
Read more >Adding Rate Limit for Spring Cloud Netflix Zuul
All the rate-limiting implementation is done using Zuul Filters and applying the validations based on the configuration set per service, in case ...
Read more >Secure Rate Limiting with Spring Cloud Gateway
In this article, you will learn how to configure rate limiting with Spring Cloud Gateway for authenticated user with Spring Security.
Read more >Rate Limiting In Spring Cloud Gateway With Redis
Currently Spring Cloud Gateway is second the most popular Spring Cloud project just after Spring Cloud Netflix (in terms of number of stars ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It would be great if you could apply code formatting to your inputs, it makes it a little hard to read without the formatting. You can follow this link to learn how to do it https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code
Great! It works now
I changed ‘policies’ to ‘policy-list’ , now its working. @marcosbarbero Thank you