1

Till now I have setup these, but it result in ratelimiting without any conditions

resilience4j.ratelimiter:
  instances:
    basic:
      limitForPeriod: ${RATE_LIMIT_PERMISIBLE_HITS:1000}
      limitRefreshPeriod: ${RATE_LIMIT_REFRESH_RATE:1h}
      timeoutDuration: ${RATE_LIMIT_TIMEOUT:20s}
      registerHealthIndicator: ${RATE_LIMIT_HEALTH_INDICATOR:true}
      eventConsumerBufferSize: ${RATE_LIMIT_EVENT_BUFFER:100}
@PostMapping
@RateLimiter(name = "basic", fallbackMethod = "rateLimiterFallback")
suspend fun getTradeEngineResponse(@Valid @RequestBody tradeEngineRequest: TradeEngineRequest): ResponseMessage {
    return Response<ResponseMessage>().ok(
            ResponseMessage(id = tradeEngineService.getTradeEngineResponse(tradeEngineRequest), message = SaasConstants.SUCCESS_MESSAGE)
    )
}

Expecting to have a flag before @RateLimiter annotation based on that apply ratelimiter

M. Deinum
  • 115,695
  • 22
  • 220
  • 224

0 Answers0