Interface RetrofitRateLimiter


  • public interface RetrofitRateLimiter
    Decorates a Retrofit Call to check with a RateLimiter if a call can be made. Returns an error response with a HTTP 429 (too many requests) code and a message which indicates that the client prevented the request.

    RetrofitRateLimiter.decorateCall(rateLimiter, call);

    • Method Summary

      Static Methods 
      Modifier and Type Method Description
      static <T> retrofit2.Call<T> decorateCall​(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, retrofit2.Call<T> call)
      Decorate Calls allow CircuitBreaker functionality.
    • Method Detail

      • decorateCall

        static <T> retrofit2.Call<T> decorateCall​(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter,
                                                  retrofit2.Call<T> call)
        Decorate Calls allow CircuitBreaker functionality.
        Type Parameters:
        T - Response type of call
        Parameters:
        rateLimiter - RateLimiter to apply
        call - Call to decorate
        Returns:
        Original Call decorated with CircuitBreaker