Disable DNS caching in the Java Virtual Machine
In an environment where you want to load-balance requests across multiple read
replicas, you need to disable DNS caching in the Java Virtual Machine (JVM) and provide
Neptune's reader endpoint while creating the Cluster object
java.security.Security.setProperty("networkaddress.cache.ttl", "0");
However, a more complete and robust solution for load-balancing is provided by the
Amazon Gremlin Java client code