spring-cloud / spring-cloud-gateway

An API Gateway built on Spring Framework and Spring Boot providing routing and more.
http://cloud.spring.io
Apache License 2.0
4.54k stars 3.33k forks source link

Rate Limiting not getting enabled in Spring Cloud Gateway #3095

Closed sanketkeskar closed 1 year ago

sanketkeskar commented 1 year ago

@spencergibb @GuyLewin @royclarkson @rmorgan @jvalkeal @scottfrederick I am trying to implement rate limiting in my Gateway by connecting to AWS Redis cluster. But rate limiting is not getting enabled and I am getting "X_RateLimiting-Remaining" as -1. I searched and got to know that if "X-RateLimiting-Remaining" is -1 then rate limiting is not enabled/configured.

image

Please note that the AWS Redis cluster is up and running when tested by separate sample working springboot code.

pom.xml: pom.txt

application.yml image

Class: image

Logs: Ignore last 2 lines of logs

2023-10-10 01:08:03.925 INFO 9692 --- [main] c.l.a.g.filter.pre.ServiceAccountFilter : STSServiceFilter () 2023-10-10 01:08:04.098 INFO 9692 --- [main] o.s.b.web.embedded.netty.NettyWebServer : Netty started on port(s): 9400 2023-10-10 01:08:04.239 INFO 9692 --- [main] c.l.a.g.GatewayWithFiltersApplication : Started GatewayWithFiltersApplication in 10.514 seconds (JVM running for 11.745) 2023-10-10 01:08:08.813 INFO 9692 --- [reactor-http-nio-2] io.lettuce.core.EpollProvider : Starting without optional epoll library 2023-10-10 01:08:08.813 INFO 9692 --- [reactor-http-nio-2] io.lettuce.core.KqueueProvider : Starting without optional kqueue library 2023-10-10 01:08:10.274 INFO 9692 --- [reactor-http-nio-2] c.l.a.g.filter.pre.ServiceAccountFilter : ::::: Entry Gateway Service Account Filter 2023-10-10 01:08:10.274 INFO 9692 --- [reactor-http-nio-2] c.l.a.g.filter.pre.ServiceAccountFilter : JWT Token validation passed. Request routed to the DownStream API

Really stuck at this part and not getting help from anywhere. Please assist on the above.

spencergibb commented 1 year ago

In the future, please don't use images of text.

I know nothing of running redis in AWS.

Also, the versions of spring boot and spring cloud are old and unsupported, please upgrade to a supported version and verify the problem still exists.

spring-cloud-issues commented 1 year ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 1 year ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.