3

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.

S Khandelwal
  • 199
  • 2
  • 13

1 Answers1

3
Jedis jedis = new Jedis(getHost(), getPort());
jedis.connect();
jedis.flushAll();
jedis.disconnect();