ratelimitj
ratelimitj copied to clipboard
Hard redis Dependency
If redis is down the whole reactive app stops working . This is due to the fact that there is no timeout setup
To fix the issue
public static final ExecutorService CANCEL_EXECUTOR = Executors.newCachedThreadPool(); .cancelOn(Schedulers.fromExecutor(RedisCacheApiConfiguration.CANCEL_EXECUTOR)) .timeout(Duration.ofMillis(config.getReadTimeout()))
Notice we will need a different scheduler for cancel because redis has a bug where on cancel it blocks the core thread.