title: What is a proper way to connect to AWS Elasticache (Redis cluster) from Java?
body: <p>I'm new to <strong>AWS Elasticache redis</strong>, and I got below endpoint.</p>
  
  <p><a href="https://i.stack.imgur.com/MMlVP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MMlVP.png" alt="Image"></a></p>
  
  <p>I'm confused in either using <strong>Jedis</strong> and <strong>Redisson</strong>, because both provides single connection and cluster connection class.</p>
  
  <p>Like in <strong>Jedis</strong>, for a single connection we can use:</p>
  
  <pre><code>Jedis conn = new Jedis("endpoint_address");
  </code></pre>
  
  <p>And for cluster connection we use:</p>
  
  <pre><code>Set&lt;HostAndPort&gt; jedisClusterNodes = new HashSet&lt;HostAndPort&gt;();
  jedisClusterNodes.add(new HostAndPort("redis_cluster_ip", 7379));
  JedisCluster jc = new JedisCluster(jedisClusterNodes);
  </code></pre>
  
  <p>These option also occur when I want to use <strong>Redisson</strong>. I'm not try to compare these two lib, my question is: WHICH ONE is the right method of connecting to <em>AWS Redis Elasticache</em> cluster, when you only have one end-point and still can utilize AWS auto scaling feature?</p>
  
  <p>Expected answer is: use SINGLE or CLUSTER MODE.</p>
  
  <p>Thanks :)</p>