0

In my existing Spring boot application I am trying to implement rate limit concept. I want to store the data in key value pair in cache like: key will be my user id and value will be no.

For spring boot rate limit I have tried below approach and its not working so I am trying using cache option. Below options I have tried

  1. Using Bucket concept its working but for all application wise but not for any specific user. Specific like: I want to search the product 5 times in 1 min, If its exceed to 6 th times then it will throw an error. Its working but not for user specific.
  2. I have tried with IP-address but its not working because for my client side all user having the same IP-address
M. Deinum
  • 115,695
  • 22
  • 220
  • 224
  • have you seen:https://www.baeldung.com/spring-bucket4j#spring-interceptor , section "API Clients and Pricing Plan" ? This topic has many articles and even many stackoverflow posts: https://stackoverflow.com/questions/44042412/how-to-set-rate-limit-for-each-user-in-spring-boot. Please share code with your solution and state what is not working. – fascynacja Apr 11 '23 at 05:50
  • I have checked the above post but its not the user specific. – Nihar Ranjan Khatua Apr 11 '23 at 07:15
  • Please provide enough code so others can better understand or reproduce the problem. – Community Apr 11 '23 at 19:06

0 Answers0