Switching between the Nodes in ElasticSearch using JEST client

I have 3 Nodes in my ElasticSearch Cluster. eg.,,

Now i am trying to connect to the Cluster using Jest Client API and giving the IP( of one of the above nodes. Now if the Node( is down, so does that mean that i would not able to acess the custer ?

How to handle this kind of problem where we have multiple nodes and we try to connect to the culster from the code using one IP address ?


Should I go and create other Connection giving the other IP address ? which I feel is very Cude way of doing it because, what if we have 100 node, In that case we would end up trying to connect to 100 nodes one after other.

Need urgent assistance.

Thanks in advance, MIK