سؤال

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));
هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top