I have spring boot project. I am using redis as cache manager. I want to clear redis cache with java program. I want to call one api and it will clear my cache.
I already know about redis-cli flushdb command.
I am not expecting command line code. Redis cache server can be on any machine.
Jedis jedis = new Jedis(getHost(), getPort());
jedis.connect();
jedis.flushAll();
jedis.disconnect();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With