1

I am making a describeCacheClusters request as follows and get a valid response but the getCacheClusters() method returns null even though that cluster has available nodes. Is there another request I should be using or a missing parameter?

DescribeCacheClustersResult result = awsClient
        .describeCacheClusters(new DescribeCacheClustersRequest()
        .withCacheClusterId(ELASTICACHE_CLUSTER_ID));
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
  • You can generate hostname as it always has the format CLUSTER_NAME.f1xaiv.0001.use1.cache.amazonaws.com where 0001 is the number of the node. – Usman Ismail Aug 02 '12 at 15:38
  • possible duplicate of [Finding AWS ElastiCache endpoints with Java](http://stackoverflow.com/questions/9691276/finding-aws-elasticache-endpoints-with-java) – Steffen Opel Aug 02 '12 at 22:28

1 Answers1

1

You are missing a parameter indeed due to a somewhat confusing API design resp. documentation issue with Amazon ElastiCache:

You need to add setShowCacheNodeInfo() to your DescribeCacheClustersRequest and call getCacheNodes() for each CacheCluster retrieved via getCacheClusters() from the DescribeCacheClustersResult - see my answer to the semantic duplicate Finding AWS ElastiCache endpoints with Java for details and code samples.

Community
  • 1
  • 1
Steffen Opel
  • 63,899
  • 11
  • 192
  • 211