I have used Redission client libraries to create an RMap
. When I am fetching the data Redis does 2 commands to fetch the data which is what I want to reduce.
Here is my Sample Code:
RMap<String, Map<String, List<String>>> map = redisClient.getMap("mycache");
String result = Optional.ofNullable(map).map(aMap -> aMap.get(key1)).map(aMap-> aMap.get(key2));
When running this code in debug, I see that for each get()
, redission client is fetching from the redis server.
Is there a way I can reduce the call to just one? In fact, I have a 4 level map object in cache and 4 calls to the redis server is taking roughly around 200 ms which is what I want to improve. Any suggestion is welcome. FYI, I am using Open Source redission client not the PRO version.