I am using Spring RedisTemplate (spring -data-redis 1.7.1) to communicate with Redis. I need to get and then delete the keys using regexp (ex: "context: user1: *"). I use the method "RedisTemplate.keys (...)" to get an array of keys
{ String key = String.format("%s:%s:%s", context, userId,"*"); Set<byte[]> keys = redisTemplate.getConnectionFactory().getConnection().keys(key.getBytes()); logger.debug(String.format("test log")); }
But at 8-9, an iterative call to restTemplates.keys (...) stops the execution of my java service. The method call does not return from the framework. My service hangs up. It also happens every time. The workaround is just restarting the service.
java spring redis
Dmitry Igumnov
source share