Is there any way to handle "Redis Connection Error"?

Viewed 19

I'm trying to use redis as rate-limit Token bucket.
And what I want is that if can't connect to redis, just pass the request.

It's already implemented in spring cloud gateway.

flux.onErrorResume(throwable -> {
    if (log.isDebugEnabled()) {
        log.debug("Error calling rate limiter lua", throwable);
    }
    return Flux.just(Arrays.asList(1L, -1L));
})

If error occurred, it just return Flux.
But, it takes too long time(1 minute)
So, is there any way not try to connect to the redis, once it failed?

0 Answers
Related