title: Whats the correct usage of org.redisson.api.RedissonClient.getMap(..)
body: <p>Service1 running in Node1
  Service1 adds user data in Redis Bucket "UserBucket"</p>
  
  <p>Service2 running in Node2
  Service2 needs to fetch the latest user data from Redis Bucket "Users"</p>
  
  <p>I maintain a singleton instance of org.redisson.api.RedissonClient inside Service2</p>
  
  <p>Initially my getCache() looked like </p>
  
  <pre><code>private static RMap&lt;String, Map&lt;String,User&gt;&gt; getCache(String bucketName) {
    return redissonCacheClient.getMap(bucketName);
  }
  </code></pre>
  
  <p>Then I looked at getMap() implementation inside org.redisson.api.RedissonClient</p>
  
  <pre><code>return new RedissonMap&lt;K, V&gt;(connectionManager.getCommandExecutor(), name, this, null);
  </code></pre>
  
  <p>It seems every single getMap(..) call creating new instance of RedissonMap(..)</p>
  
  <p>So I am now maintaining a single instance of RMap as follows (instead of calling getMap() every time) ... </p>
  
  <pre><code>private static RMap&lt;String, Map&lt;String,User&gt;&gt; getCache(String bucketName) {
          RMap&lt;String, Map&lt;String,User&gt;&gt; userMap;
          if (cacheByOrg.containsKey(bucketName)) {
              userMap = cacheByOrg.get(bucketName);
          } else {
              userMap = redissonCacheClient.getMap(bucketName);
              cacheByOrg.put(bucketName, userMap);
          }
          return geoFenceMap;
      }
  </code></pre>
  
  <p>But now I suspect, I am not getting the latest data from cache.</p>
  
  <p>It would be great, if someone can confirm the correct usage of Redisson client.</p>
  
  <p>Is it Okay to call getMap() many times (is it going to connect to the same instance of cache instance internally so that I always get latest data ? If yes, then can creating so many RedissonMap instance may lead to OOM / GC overhead ? </p>
  
  <p>Otherwise should I call it only once and keep a local copy as demonstrated ?</p>