Package io.github.resilience4j.retrofit
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);
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRetrofitRateLimiter.RateLimitingCall<T> -
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)DecorateCalls allowCircuitBreakerfunctionality.
-
Method Details
-
decorateCall
static <T> retrofit2.Call<T> decorateCall(io.github.resilience4j.ratelimiter.RateLimiter rateLimiter, retrofit2.Call<T> call)DecorateCalls allowCircuitBreakerfunctionality.- Type Parameters:
T- Response type of call- Parameters:
rateLimiter-RateLimiterto applycall- Call to decorate- Returns:
- Original Call decorated with CircuitBreaker
-