Getting Error while accessing DAX AWS from localhost client
Error:
EVERE: caught exception during cluster refresh: java.io.IOException: failed to configure cluster endpoints from hosts: [daxcluster*:8111] java.io.IOException: failed to configure cluster endpoints from hosts:
Sample test code
public static String clientEndPoint = "*.amazonaws.com:8111";
DynamoDB getDynamoDBClient() {
System.out.println("Creating a DynamoDB client");
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard().withRegion(Regions.US_EAST_1).build();
return new DynamoDB(client);
}
static DynamoDB getDaxClient(String daxEndpoint) {
ClientConfig daxConfig = new ClientConfig().withEndpoints(daxEndpoint);
daxConfig.setRegion(Regions.US_EAST_1.getName());
AmazonDaxClient client = new ClusterDaxClient(daxConfig);
DynamoDB docClient = new DynamoDB(client);
return docClient;
}
public static void main(String args[]) {
DynamoDB client = getDaxClient(clientEndPoint);
Table table = client.getTable("dev.Users");
Item fa = table.getItem(new GetItemSpec().withPrimaryKey("userid", "tf@gmail.com"));
System.out.println(fa);
}